|
-
May 23rd, 2005, 07:46 PM
#1
Thread Starter
Addicted Member
Question about forms
my program has two forums. One form is the startup form and it has a button that will open another form and set some variables up. I want to add abutton on the second form that when clicked, it will close itself and then reopen the first form and basically set everything to 0 or null. I'm not sure how to do this, because when the second form is running, the first form is in the ".hide" state. Any ideas?
John
-
May 23rd, 2005, 08:35 PM
#2
Addicted Member
Re: Question about forms
You can do something like this
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm1 as Form1 'Replace Form1 wit ur 1st Form name ;)
'Close the Main form with
frm1.close 'We do this w/o an error cuz v kno the form is already loaded. Then
Dim frmn1 as new Form1
frmn1.show()
End sub
p.s. I kno its kinda crude....plz dont quote that
-
May 23rd, 2005, 08:46 PM
#3
Re: Question about forms
VB Code:
'in your first form button click event
dim s as string="blah..blah"
dim i integer=3
dim f as new form2()
f.showdialog()
'after showdialog now set your variables to 0 or null
s=""
i=0
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|