|
-
October 5th, 2005, 09:18 PM
#1
next form
hey..
i would like to know how would i be able to add a button to a form and wen its clicked go to another form..
thanks..
-
October 6th, 2005, 01:13 AM
#2
Re: next form
Add the button, and double click on it. You will generate the Click event handler. Inside the method write:
Code:
Dim nextForm as New Form2
nextForm.Top = Me.Top
nextForm.Left = Me.Left
nextForm.Width = Me.Width
nextForm.Height = Me.Height
Me.Visible = False
nextForm.Show()
-
October 7th, 2005, 05:24 PM
#3
Re: next form
thanks alot that worked. But i got a question. When i get this "Sub Main was not found", how can i avoid this when creating more then 1 form.
-
October 8th, 2005, 02:13 PM
#4
Re: next form
Either set the properties Startup object, or create a Sub Main
To set the startup object, right-click on the project in Solution Explorer, and you will see in General option the Startup Object field. You will see all the forms in the project and Sub Main. Just select one of the forms.
To create a Sub Main (you only need to do this if showing the form is not the only thing you need to do on application startup like reading user command line arguments):
Add this sub to one of your classes:
Code:
Public Shared Sub Main()
Application.Run(New Form1());
End Sub
You can run one form, and you can also read arguments (look at MSDN)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|