| | |
Switching Between Forms
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 19
Reputation:
Solved Threads: 0
I want to use more than one form in my project and be able to code a button or something that will do that. I tried this on Form1 and it worked.
BUT then I tried the following on Form2 to go back to Form1 and it doesn't work... the button does nothing.
Also, when the user switches to a different form, will the variables assigned on the first form still be assigned on the second form (assuming they're declared as Public in the module?
VB.NET Syntax (Toggle Plain Text)
Public Class Form1 Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click 'Goes from this form to form 2 My.Forms.Form2.Show() End Sub End Class
BUT then I tried the following on Form2 to go back to Form1 and it doesn't work... the button does nothing.
VB.NET Syntax (Toggle Plain Text)
Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click My.Forms.Form1.Show() 'Doesn't work End Sub End Class
![]() |
Similar Threads
- IIS .NET2 virtual directory not working (ASP.NET)
- User Controls as Forms within a Form (VB.NET)
- Changing/Switching to Forms Without Seeing the Desktop (VB.NET)
- Problem with 2 forms (C#)
- openin more forms C# (C#)
- Need Help! (Windows NT / 2000 / XP)
- switching between forms (PHP)
- How to free resources for other processes (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: Need Help Save Settings
- Next Thread: Having a problem with datagrid view and combobox
Views: 260 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2008 access advanced application array basic beginner browser button buttons center checkbox class client code combo convert cuesent data database datagrid datagridview date datetimepicker design designer dissertation dissertations dissertationtopic eclipse excel fade filter forms generatetags html images input intel internet lib listview map mobile monitor net number objects open panel pdf picturebox picturebox2 port position print printing problem read remove richtextbox save searchvb.net select serial settings shutdown socket sorting sqlserver studio survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol validation vb vb.net vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web webbrowser winforms winsock wpf wrapingcode year





