close form
-
vb.net: i want to set a boolean variable to false, when a certain form is closed. how can i catch this close-event?
-
vb.net: i want to set a boolean variable to false, when a certain form is closed. how can i catch this close-event?
Hi,
klappklapp wrote:
how can i catch this close-event?
First of all there is no close event. There is an Unload event. Also i am assuming that you want to set a boolean value to false when a form is unloaded. Then just write the code - someBoolvar = False in form_unload event. Or if you want to call some function when a form is unloaded either the same syntax can be used or you can subscribe to the unload event of that form. Just find the form object press "." and find the unload event. In this way your function will be called whenever the unload event is fired of that form. Hope i am clear. and my assumptions are rigth. Anant Y. Kulkarni
-
vb.net: i want to set a boolean variable to false, when a certain form is closed. how can i catch this close-event?
hi, i'm not soo agree with the guy answered before i just tryed close event for the same target it works be sure man ;) try to be good if you can't be the best
-
Hi,
klappklapp wrote:
how can i catch this close-event?
First of all there is no close event. There is an Unload event. Also i am assuming that you want to set a boolean value to false when a form is unloaded. Then just write the code - someBoolvar = False in form_unload event. Or if you want to call some function when a form is unloaded either the same syntax can be used or you can subscribe to the unload event of that form. Just find the form object press "." and find the unload event. In this way your function will be called whenever the unload event is fired of that form. Hope i am clear. and my assumptions are rigth. Anant Y. Kulkarni
The OP didn't specify WinForms or WebForms. Your answer is WebForms specific as there is a Close event in WinForms.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog
-
vb.net: i want to set a boolean variable to false, when a certain form is closed. how can i catch this close-event?
You can add an event handlier for the closing or closed event. If you chose the closing event be aware that the form might not get closed as another event handler for the closing event will be given the opportunity to cancel the action. NOTE: This assumes you are talking about a Win Forms application.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog
-
You can add an event handlier for the closing or closed event. If you chose the closing event be aware that the form might not get closed as another event handler for the closing event will be given the opportunity to cancel the action. NOTE: This assumes you are talking about a Win Forms application.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog
win form, it is. thanks.
-
win form, it is. thanks.