on closing event of the form

  • Thread starter Daniel Sélen Secches
  • Start date
D

Daniel Sélen Secches

Hi all

I want to do in my application something like we have on ICQ. when you close
the application it doesn't close.

I've done like that

Private Sub Form1_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = CancelFlag
If CancelFlag Then
Me.Hide()
End If
End Sub

and i've put in a exit button click that

cancelflag = False
iconn.Visible = False
Me.Close()

it works just fine... but when i try to close the windowsXP with the program
running it won't close.

what can i do?
who to know if the close event comes from window or from the user?


--
tks.

Daniel Sélen Secches
CWD Web Internet.
www.cwd.com.br
 
H

Herfried K. Wagner [MVP]

* "Daniel Sélen Secches said:
I want to do in my application something like we have on ICQ. when you close
the application it doesn't close.

I've done like that

Private Sub Form1_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = CancelFlag
If CancelFlag Then
Me.Hide()
End If
End Sub

and i've put in a exit button click that

cancelflag = False
iconn.Visible = False
Me.Close()

it works just fine... but when i try to close the windowsXP with the program
running it won't close.

You can detect when Windows wants to shutdown/... and allow closing:

<http://dotnet.mvps.org/dotnet/samples/windowsandforms/downloads/CloseWindow.zip>
 
D

Daniel Sélen Secches

i'll test it... tks... : >

do you have that file with english comments? :>

tks again..
 
H

Herfried K. Wagner [MVP]

* "Daniel Sélen Secches said:
i'll test it... tks... : >

do you have that file with english comments? :>

I feel sorry, currently it's only available in German.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top