You have to instantiate the form first. Form2 is just a class that is used to create new Form2 objects. If the form you created is named Form2, then you need to create a variable of type Form2 and assign it a new instance of Form2. I'm not a C# programmer, so I can only show you an example in VB:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyForm2 Form2 = New Form2
MyForm2.ShowDialog()
- or -
Myform2.Show()
...
End Sub
Hope this helps. :)
-----
Lee Perkins
>I'm working with Winforms and looking for a command to show another form with the click of a command button. I have tried Form2.Show() but that doesn't seem to work. Do I need any using statements that are not added by default? I'm writing code in C#.
-----
Lee Perkins
TigerBase Technologies
"Lee is one that would plug his brain into the internet, if he could, and STILL scream for more" - Very good friend of Lee's