Showing a form in VB .NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm new to VB .NET and having trouble displaying a form using a button on the
startup form.

In VB4 I simply used the following to load a form as modal when a button was
clicked.

formName.Show 1

I can't seem to do the same in VB .NET.
 
Hi Rick,

I believe you are looking for

formName.ShowDialog()

formName.Show() will display it as modeless
 
VB6 and below automatically created a default instance of a form. VB.Net
does not.

You have to declare it and then instantiate it

Dim myForm as formName = New formName
formName.Show
 
Rick,

To make both previous messages one
Dim myForm as New formName
formName.showdialog

Cor
 
Since the main form is already open,and does not have default instance
defined, how do you access its controls from a sub from?

For instance form1 is my main form, and I create from2, and show it from
form1. Then from from2 I want to change a label text on form1.

Thanks in advance.

Jerod
 
Back
Top