|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
What is the event to trap when user clicks X to close form?On my form if the user clicks the upper right hand corner to close the form
I want to trap that event and do a check to see if closing is allowed, if not, I want to stop the form closing action. Can anyone tell me how I can do this? Thanks for any help Bob Form_Close event is fired when u try to close form.
On Sat, 21 Oct 2006 16:59:07 +0100, Robert Dufour <bduf***@sgiims.com> wrote: Show quoteHide quote > On my form if the user clicks the upper right hand corner to close the > form > I want to trap that event and do a check to see if closing is allowed, if > not, I want to stop the form closing action. > > Can anyone tell me how I can do this? > > Thanks for any help > Bob > > Don't forget the Form.Closing Event. Which is fired before the disposal.
-- Thiele Enterprises - The Power Is In Your Hands Now! -- "Tiago Salgado" <tiagosalgado.develo***@gmail.com> wrote in message news:op.thsfgaqtdysvon@tiagosalgado...Form_Close event is fired when u try to close form. On Sat, 21 Oct 2006 16:59:07 +0100, Robert Dufour <bduf***@sgiims.com> wrote: > On my form if the user clicks the upper right hand corner to close the > form > I want to trap that event and do a check to see if closing is allowed, if > not, I want to stop the form closing action. > > Can anyone tell me how I can do this? > > Thanks for any help > Bob > > "Robert Dufour" <bduf***@sgiims.com> schrieb: In addition to the other replies:> On my form if the user clicks the upper right hand corner to close the > form I want to trap that event and do a check to see if closing is > allowed, if not, I want to stop the form closing action. If you are using .NET 2.0, check out the form's 'FormClosing' event too. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> There is also the option to override the WndProc method if you really
needed to. Thanks, Seth Rowe Herfried K. Wagner [MVP] wrote: Show quoteHide quote > "Robert Dufour" <bduf***@sgiims.com> schrieb: > > On my form if the user clicks the upper right hand corner to close the > > form I want to trap that event and do a check to see if closing is > > allowed, if not, I want to stop the form closing action. > > In addition to the other replies: > > If you are using .NET 2.0, check out the form's 'FormClosing' event too. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://dotnet.mvps.org/dotnet/faqs/> On Sat, 21 Oct 2006 11:59:07 -0400, "Robert Dufour" <bduf***@sgiims.com> wrote: In VB6, there was the QueryUnload event which had an UnloadMode argument, one of>On my form if the user clicks the upper right hand corner to close the form >I want to trap that event and do a check to see if closing is allowed, if >not, I want to stop the form closing action. > >Can anyone tell me how I can do this? > >Thanks for any help >Bob > which was vbFormControlMenu which was specific to the "X" button and the control menu, "Close". In .Net, AFAIK, there is no functional equivalent short of using the WndProc method. FormClosing event will fire when the "X" button is pressed (3-User Closing), but it also fires for the same reason if Me.Close() is called - 3-User Closing. Gene Thank you all
Show quoteHide quote "gene kelley" <o***@by.me> wrote in message news:tcemj2p9n2q86umk17o5qvohg2qkd8mlv2@4ax.com... > On Sat, 21 Oct 2006 11:59:07 -0400, "Robert Dufour" <bduf***@sgiims.com> > wrote: > >>On my form if the user clicks the upper right hand corner to close the >>form >>I want to trap that event and do a check to see if closing is allowed, if >>not, I want to stop the form closing action. >> >>Can anyone tell me how I can do this? >> >>Thanks for any help >>Bob >> > > In VB6, there was the QueryUnload event which had an UnloadMode argument, > one of > which was vbFormControlMenu which was specific to the "X" button and the > control > menu, "Close". > > In .Net, AFAIK, there is no functional equivalent short of using the > WndProc method. > FormClosing event will fire when the "X" button is pressed (3-User > Closing), but it > also fires for the same reason if Me.Close() is called - 3-User Closing. > > Gene
Backing up with SQL MO
Best way to store dataset to disk??? Query results to file Transparent BackGround Newb looking for data binding help Datasets and Adapter Updates how to translate from c# this instruction Webbrowser control - buffering - audio/video playback problem... Using VB and ADO.NET Windows service LocalSystem account |
|||||||||||||||||||||||