qry in redirecting

srivalli

Well-known member
Joined
May 4, 2005
Messages
189
Programming Experience
Beginner
in my project
i have two forms
when i am redirecting from one form to other form ,
when i close second form ,i want to close the first form automatically
is there any option
thks
 
no i am talking abt vb.net forums

if i go from first form to next form,
when i close the second form ,i want to close the first form automatically
hope my question is clear
i used redirecting because when we jump from one form to another , we generally use "redirecting"
that all
thanks
kulrom said:
Are you talking about ASP.NET WEB FORMS?

Cheers ;)
 
put the code in Query_Unload(sorry if the name gets wrong some VB6 memories ;) ) Event and verify a class level flag which indicate that you are going to another form or just closing it, if the case is first , open the form and let the processing continues.
now how to self trigger the operation, place the code
me.Unload
from where you want to jump from one form to another and also set the flag that the call from urs not by other source.
though not perfect but can solve your problem.
 
There are many tricky ways to achieve this. But if you want to close any other forms just by clicking a button (e.g btnExit) in frm2 for example, just put Application.Exit() at the end of the codes in btnExit.

Anyway, you can try this (modified from what JuggaloBrotha taught me :) once), add a code module to the project in the module:
VB.NET:
[color=Blue]Friend [/color]theForm [color=Blue]As[/color] frm1

in the frm1 load event add:
VB.NET:
theForm = [color=Blue]Me[/color]

somewhere in frm1
VB.NET:
Friend Sub CloseMe()
	[color=Blue]Me[/color].Close
End Sub

in frm2 closing event:
VB.NET:
theForm.CloseMe()
 
Back
Top