Another question: Is there a way to determine if a form has been closed?
I.E. A property or something? Like an IsClosed or something similar? I have
instances where I load a new form, and in that new form I have overridden
the New constructor which may (after reading some data) decide to close the
form before it is shown. I would like to be able to tell from the caller if
that form had already been closed. I can setup my own property like
Cancelled (as a boolean) and set/check that, but was wondering if there were
a direct framework/windows forms method of determining if Me.Close had
already been called.
Thanks.
Tom 4 2632
"Tom" <to*@nospam.com> wrote in message
news:OB**************@TK2MSFTNGP12.phx.gbl... Another question: Is there a way to determine if a form has been closed? I.E. A property or something? Like an IsClosed or something similar? I
have instances where I load a new form, and in that new form I have overridden the New constructor which may (after reading some data) decide to close
the form before it is shown. I would like to be able to tell from the caller
if that form had already been closed. I can setup my own property like Cancelled (as a boolean) and set/check that, but was wondering if there
were a direct framework/windows forms method of determining if Me.Close had already been called.
If I undertstand you correctly, I'd just add an eventhandler for that forms
closing event, and then respond to it from there. That way you know you'll
catch it and you won't have to poll for it. If you do it the way you
mention, you'll have to check each time you want to do x. INstead just use
the eventhandling model so you'll know exactly when it happens and can
respond accordingly. This willl still allow you to work in the fashion you
mention, it will just provide a lot of additional functionality. Thanks.
Tom
--
W.G. Ryan, eMVP http://forums.devbuzz.com/ http://www.knowdotnet.com/williamryan.html http://www.msmvps.com/WilliamRyan/
Not being totally sure why you want to do this, but if you simply want the
form to not be displayed on screen or not, you could trap the close event
and do a me.hide, then cancel the close.
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... "Tom" <to*@nospam.com> wrote in message news:OB**************@TK2MSFTNGP12.phx.gbl... Another question: Is there a way to determine if a form has been closed? I.E. A property or something? Like an IsClosed or something similar? I have instances where I load a new form, and in that new form I have
overridden the New constructor which may (after reading some data) decide to close the form before it is shown. I would like to be able to tell from the caller if that form had already been closed. I can setup my own property like Cancelled (as a boolean) and set/check that, but was wondering if there were a direct framework/windows forms method of determining if Me.Close had already been called. If I undertstand you correctly, I'd just add an eventhandler for that
forms closing event, and then respond to it from there. That way you know
you'll catch it and you won't have to poll for it. If you do it the way you mention, you'll have to check each time you want to do x. INstead just
use the eventhandling model so you'll know exactly when it happens and can respond accordingly. This willl still allow you to work in the fashion
you mention, it will just provide a lot of additional functionality. Thanks.
Tom
--
W.G. Ryan, eMVP
http://forums.devbuzz.com/ http://www.knowdotnet.com/williamryan.html http://www.msmvps.com/WilliamRyan/
Terry,
That would be the Closing event, as you can cancel it.
The Closed event itself is too late.
Hope this helps
Jay
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:Oh*************@TK2MSFTNGP11.phx.gbl... Not being totally sure why you want to do this, but if you simply want the form to not be displayed on screen or not, you could trap the close event and do a me.hide, then cancel the close.
--
OHM ( Terry Burns ) . . . One-Handed-Man . . .
"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... "Tom" <to*@nospam.com> wrote in message news:OB**************@TK2MSFTNGP12.phx.gbl... Another question: Is there a way to determine if a form has been
closed? I.E. A property or something? Like an IsClosed or something similar? I have instances where I load a new form, and in that new form I have overridden the New constructor which may (after reading some data) decide to
close the form before it is shown. I would like to be able to tell from the
caller if that form had already been closed. I can setup my own property like Cancelled (as a boolean) and set/check that, but was wondering if
there were a direct framework/windows forms method of determining if Me.Close had already been called. If I undertstand you correctly, I'd just add an eventhandler for that
forms closing event, and then respond to it from there. That way you know you'll catch it and you won't have to poll for it. If you do it the way you mention, you'll have to check each time you want to do x. INstead just use the eventhandling model so you'll know exactly when it happens and can respond accordingly. This willl still allow you to work in the fashion you mention, it will just provide a lot of additional functionality. Thanks.
Tom
--
W.G. Ryan, eMVP
http://forums.devbuzz.com/ http://www.knowdotnet.com/williamryan.html http://www.msmvps.com/WilliamRyan/
Yes, that was a typo or mindslip, whichever you prefer
Thanks
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:OK****************@TK2MSFTNGP10.phx.gbl... Terry, That would be the Closing event, as you can cancel it.
The Closed event itself is too late.
Hope this helps Jay
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in
message news:Oh*************@TK2MSFTNGP11.phx.gbl... Not being totally sure why you want to do this, but if you simply want
the form to not be displayed on screen or not, you could trap the close
event and do a me.hide, then cancel the close.
--
OHM ( Terry Burns ) . . . One-Handed-Man . . .
"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... "Tom" <to*@nospam.com> wrote in message news:OB**************@TK2MSFTNGP12.phx.gbl... > Another question: Is there a way to determine if a form has been closed? > I.E. A property or something? Like an IsClosed or something similar?
I have > instances where I load a new form, and in that new form I have
overridden > the New constructor which may (after reading some data) decide to close the > form before it is shown. I would like to be able to tell from the caller if > that form had already been closed. I can setup my own property like > Cancelled (as a boolean) and set/check that, but was wondering if there were > a direct framework/windows forms method of determining if Me.Close
had > already been called. If I undertstand you correctly, I'd just add an eventhandler for that forms closing event, and then respond to it from there. That way you know you'll catch it and you won't have to poll for it. If you do it the way you mention, you'll have to check each time you want to do x. INstead
just use the eventhandling model so you'll know exactly when it happens and can respond accordingly. This willl still allow you to work in the
fashion you mention, it will just provide a lot of additional functionality. > > Thanks. > > Tom > >
--
W.G. Ryan, eMVP
http://forums.devbuzz.com/ http://www.knowdotnet.com/williamryan.html http://www.msmvps.com/WilliamRyan/
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: RAJ |
last post by:
hi
plz tell me how to know "how window is going to close"...
i have to right code for X button of forms...
plz telll me
thanks
bye
|
by: VM |
last post by:
Hi,
Is it possible to open always only one instance of a MDIChild form?
Say, if form A is already opened, just give it the focus.
I tried declaring theMDIChild forms as private members of the...
|
by: rob willaar |
last post by:
Hi,
How can i check is a form is disposed in framework 1.1
In framework 2.0 i can check Form.IsDisposed to check if a user closed the
form
|
by: Xero |
last post by:
How do you detect whether a form has been closed or not?
Thanks.
--
Xero
http://www.chezjeff.net
My personal web portal
|
by: Geoff Jones |
last post by:
Hiya
Supposing a form has been created as follows:
Dim form1 As New Form
How can I check to see if the form has been closed i.e. by clicking on the
cross in the top right of the form.
...
|
by: Simon |
last post by:
I setup a Midi & Child form
I can open the child form and display info from a Text file
I need to enable the user to change info on the child form and when
closed write the text file back to...
|
by: Mike Baugh |
last post by:
I am using visual studio 2005 to develop a form using c#
I have 3 datagrids on one form.
I can set the row color based on a certain value in a column. However this
color applies to all 3...
|
by: Zytan |
last post by:
I have created a new form from the main form. When I close the main
form with the 'x' close button, its Form.FormClosed event is run, but
not the dialog's.
Is this normal? It is ok /...
|
by: Anil Gupte |
last post by:
I have a MDI Parent Child set of forms
FormContainer --MDIParent
FormStart --MDIChild
FormMain-->MDIChild
FormSliceInfo-->MDIChild
I use the following in the beginning of FomrContainer
...
|
by: Neil |
last post by:
"lyle" <lyle.fairfield@gmail.comwrote in message
news:48c3dde7-07bd-48b8-91c3-e157b703f92b@f3g2000hsg.googlegroups.com...
Question for you. I'm doing something similar, only, instead of opening...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |