>Sorry to jump in like this. Is there a specific reason for Minimizing the form before the application exit?No problem, Dawa ... the form will show briefly if you don't have it minimized. If you don't mind the "flash" then you don't have to do it. <g>
~~Bonnie
>
>
>>David,
>>
>>As I said in my previous reply, you need to use Application.Exit(). So, something like this in your Form's Load eventhandler:
>>
>>if (ConnectionIsOffline)
>>{
>> MessageBox.Show("You are offline. Application will be closed.");
>> this.WindowState = FormWindowState.Minimized;
>> Application.Exit();
>> return;
>>}
>>
>>
>Bonnie
>>
>>
>>
>>>Hello Bonnie...
>>>
>>>I in event LOAD verify if the connection with the server this ON LINE; if the server this OFF LINE I show a message and i want to close the form.
>>>
>>>Note: my english is not very good..