PC Review


Reply
Thread Tools Rate Thread

on closing event of the form

 
 
Daniel Sélen Secches
Guest
Posts: n/a
 
      27th Feb 2004
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


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      27th Feb 2004
* "Daniel Sélen Secches" <danielATcwdDOTcomDOTbr> scripsit:
> 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>

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Website Address Changed!
 
Reply With Quote
 
Daniel Sélen Secches
Guest
Posts: n/a
 
      27th Feb 2004
i'll test it... tks... : >

do you have that file with english comments? :>

tks again..


"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> escreveu na mensagem
news:c1njaq$1eqhek$(E-Mail Removed)...
> * "Daniel Sélen Secches" <danielATcwdDOTcomDOTbr> scripsit:
> > 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/sample...ds/CloseWindow
..zip>
>
> --
> Herfried K. Wagner [MVP]
> <http://dotnet.mvps.org/>
> Website Address Changed!



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      27th Feb 2004
* "Daniel Sélen Secches" <danielATcwdDOTcomDOTbr> scripsit:
> i'll test it... tks... : >
>
> do you have that file with english comments? :>


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

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Website Address Changed!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing Access While Form Is In Print Preview Does Not Trigger Form Unload Event Stewart Berman Microsoft Access Form Coding 3 7th Jun 2010 03:15 AM
Re: Prevent user from closing form -- form event Jeanette Cunningham Microsoft Access 2 21st Apr 2010 09:28 PM
Form.Closing event not fired always when i call Form.Close method berylwilson Microsoft Dot NET Framework Forms 1 20th Apr 2007 02:11 AM
Closing a form error 2585 This action cannot be carried out while processing a form or report event SDLittle13@gmail.com Microsoft Access Form Coding 4 11th Mar 2007 05:58 PM
Closing event in a MID Child form I don't know if the child form is closing or the main form is closing **Developer** Microsoft C# .NET 1 19th Oct 2005 04:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:43 AM.