quickbasic22
Member
This troubled me for quite awhile.
if you hide a form and goto another this is how you show that same
instance of form1 again without creating a new instance losing your data.
class form1
inherits windows.forms.form
dim secondform as form2
button1_Click(sender ,e)
me.hide
secondform = new form2
secondform.FirstForm = me secondform.show
end sub
end class
class form2
inherits windows.forms.form
public FirstForm as form1
button1_Click(sender,e)
me.hide
FirstForm.show
end sub
end class
Basically it creates form2 before it leaves form1. It Passes a reference of form1 to form2 before it leaves form1. So in secondfirm, FirstForm equals the form you left.
Edited on 2/17/2006
if you hide a form and goto another this is how you show that same
instance of form1 again without creating a new instance losing your data.
class form1
inherits windows.forms.form
dim secondform as form2
button1_Click(sender ,e)
me.hide
secondform = new form2
secondform.FirstForm = me secondform.show
end sub
end class
class form2
inherits windows.forms.form
public FirstForm as form1
button1_Click(sender,e)
me.hide
FirstForm.show
end sub
end class
Basically it creates form2 before it leaves form1. It Passes a reference of form1 to form2 before it leaves form1. So in secondfirm, FirstForm equals the form you left.
Edited on 2/17/2006
Last edited: