Open Form

  • Thread starter Thread starter Wenzee
  • Start date Start date
W

Wenzee

Hi,

I am learning visual C#.Net.I have 2 forms Form1 and Form2.
On a command button click i want to call form2.
How can i do this.?
Thanx

from
Doller
 
First, you'll need to create an instance of Form2...

Form2 form = new Form2();

... and then you'll need to show the form. If you want to display the form
modally, so that the user must dismiss the form before they can return to
Form1, then call the ShowDialog method. Otherwise, call the Show method...

form.Show();
 
In the Event for the command Button use:

Form2 form = new Form2();
form.Show();

That's it. :-D

Greetings, Peter
 
Back
Top