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.
Unfortunately, activation email could not send to your email. Please try again.

How to Show a form.

Thread ID:

Created:

Updated:

Platform:

Replies:

1958 Dec 6,2002 06:41 AM Dec 7,2002 05:15 PM Windows Forms 3
loading
Tags: FAQ
Peter
Asked On December 6, 2002 06:41 AM

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.

TVIStudent
Replied On December 6, 2002 10:09 AM

> 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()

TVIStudent
Replied On December 6, 2002 10:11 AM

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.

Administrator [Syncfusion]
Replied On December 7, 2002 05:15 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;