We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to Show a form.

I have 2 forms. Form1 and Form2. And my project is not MDI. I added a button on Form1 when I click on it I want to make Form2 visible. When I start typing in the On_Click event of the button the options I see are: Form2.ActiveForm Form2.Control Connection Form2.Def back color.... There is no Form2.Show???? Please advise! Thank you.

3 Replies

TV TVIStudent December 6, 2002 03:09 PM UTC

> I have 2 forms. Form1 and Form2. And my project is not MDI. I added a button on Form1 when I click on it I want to make Form2 visible. When I start typing in the On_Click event of the button the options I see are: > Form2.ActiveForm > Form2.Control Connection > Form2.Def back color.... > > There is no Form2.Show???? > > Please advise! > Thank you. You need to make the second form a child form... in the on click event.. Dim Form2 as new Form Form2.show() me.hide()


TV TVIStudent December 6, 2002 03:11 PM UTC

P.S. I am not sure that is the absolute correct way, but it is the way I navagate through my forms. Each time I need to go to the next form I have to make a new form object and hide the current one.


AD Administrator Syncfusion Team December 7, 2002 10:15 PM UTC

u have to remember every thing in VB.Net is class and so are your Form1 and Form2 Before using a class,u have to instantiate it or make it an object,so: Dim f2 as New Fomr2 'Fomr2 is a new class inherits from Form which is the base class of all forms f2.show() 'Now f2 is an instance of Form2 You can use show() now

Loader.
Live Chat Icon For mobile
Up arrow icon