| | |
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 |
"crystal .net .net2005 30minutes 2008 access add advanced application array assignment basic binary box button buttons center click code combo connectionstring convert cpu data database databasesearch datagrid datagridview design designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel exists firewall folder image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity pan peertopeervideostreaming picturebox picturebox2 port print printpreview record regex reports" reuse right-to-left save savedialog search serial socket sorting sqldatbase sqlserver storedprocedure string temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet vista visual visualbasic visualbasic.net visualstudio.net web wpf xml





