| | |
Starting a Program using VB Module
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jul 2008
Posts: 86
Reputation:
Solved Threads: 0
Hello everyone, I have a program that i am working on using more than one Form. The way i am going through forms is by minimizing my first form then showing the other forms. I was wondering if i start the program from a module maybe i can unload forms making my program much more effective. Here is some of my current code:
I would love to unload the current form and show emainForm. Right now i have an empty module, i would imagine i would have to make a private sub, but i wouldn't know the syntax from there. I'm guessing welcomeForm.load then unload....?
VB.NET Syntax (Toggle Plain Text)
emainForm.Show() Me.WindowState = FormWindowState.Minimized Me.Hide()
I would love to unload the current form and show emainForm. Right now i have an empty module, i would imagine i would have to make a private sub, but i wouldn't know the syntax from there. I'm guessing welcomeForm.load then unload....?
This doesn't exactly answer how to do it from the module, but shows how to create and dispose forms (from the "main" form)
I didn't check it, but you should be able to create and dispose forms from a module with the above code.
VB.NET Syntax (Toggle Plain Text)
' A global variable to "hold" the form Private aForm As Form Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' ' Create a new instance from the Form2 class aForm = New Form2 ' Show the form instance aForm.Show() End Sub Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click ' ' Close the form aForm.Close() ' And dispose it aForm = Nothing End Sub
Teme64 @ Windows Developer Blog
![]() |
Similar Threads
- Starting Python (Python)
- special keys as inputs (Game Development)
- "C:\system32\bridge.dll module cannot be located" problem (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
- Previous Thread: Multi Column List Boxes
- Next Thread: Adding Up TimeofDay to a file?
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account arithmetic array basic bing button buttons c# center check code combobox component convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog filter ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output panel passingparameters picturebox picturebox1 port position print printing problem problemwithinstallation project read remove save searchbox searchvb.net select serial server shutdown soap survey table tcp temperature text textbox timer timespan toolbox trim update updown user vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year





