Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Redirecting to another form
Message
From
17/05/2004 16:08:10
 
 
To
17/05/2004 15:49:08
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00904689
Message ID:
00904698
Views:
9
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
Previous
Reply
Map
View

Click here to load this message in the networking platform