Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Open Form2 (vb.net)
Name: Grusomhat Date: March 16, 2006 at 20:22:42 Pacific OS: XP CPU/Ram: AMD 64+ , 1gb Product: Packard Bell
Comment:
Hello Everyone.
I am making a program in vb.net and am having trouble working out how to open a new form from a button in the app. Heres what i meen. When the program starts it has a form asking for a username and password. Once the correct username and password has been entered i need the app to close the current form and open a different one. I thought it would be something like
Open.Form2 or Load.Form2 or something with open or load but apparently it's not. Does anyone have any knowledge on how to do this.
You create a new instance of the Form2 class, then call its 'Show' method.
Dim form as New Form2() form.Show 'or form.ShowDialog() for Modal forms
Good luck, -SN
0
Response Number 2
Name: Grusomhat Date: March 17, 2006 at 20:06:17 Pacific
Reply:
Thanks that works perfectly one more question i want to hide the first form and i tried the same thing but using form.hide and it doesnt work it gives an error. Any Ideas
It would be pretty helpful for you to post the error...
form.Hide() should work, but I don't know if you can hide the main form. You should use Close() if you don't plan on using the form again.
-SN
0
Response Number 4
Name: Grusomhat Date: March 17, 2006 at 20:47:47 Pacific
Reply:
It doesn't error anymore but it doesnt work either I have tried using close() but that closes bothe forms. I have also tried Form.Visible = False but no luck. Is there a command to minimise it as that wood be suffiecient.
Summary: Hello, I'm still new to programming, and then I switched from VB5 to VB.NET, so I'm really confused. I'm trying to do two things. First, I'm trying open a MSWord document using the system's defau...