liquidspaces Posted November 19, 2002 Posted November 19, 2002 I'm currently working on my first project with Visual Basic.NET. I have 2 forms. One is called Form1, the other Form2. There is a button on Form1 that when clicked, needs to close that form and open Form2. I've searched both the installed help files and the help files at Microsoft. Can anybody help me? All I need is the syntax to open Form2. Quote
wyrd Posted November 20, 2002 Posted November 20, 2002 Since VB.NET is 100% OO you need to do it slightly different. You have to reference the Form2 object before you can show it. 'Put this in your button's click event. Dim frm2 As Form2 = New Form2() frm2.Show() Quote Gamer extraordinaire. Programmer wannabe.
liquidspaces Posted November 20, 2002 Author Posted November 20, 2002 Thanks so much. I'll give it a shot when I get to work in the morning. That is weird...much different than VB 6. Quote
*Gurus* divil Posted November 20, 2002 *Gurus* Posted November 20, 2002 Forms in .NET are just classes, which inherit from Form. When you remember that they're just classes it helps you understand the differences between them and VB6 forms. The biggest thing people trip up on is the lack of a default instance of the form, with the same name. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
liquidspaces Posted November 20, 2002 Author Posted November 20, 2002 (edited) Thanks for your help. I have another question about tab controls that I posted in the forum...if you have the time to help, please do! kevin Edited November 20, 2002 by liquidspaces Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.