| | |
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 |
Tag cloud for VB.NET
.net .net2008 2008 access advanced application array basic beginner browser button buttons center click client code combo convert cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse excel exists fade filter forms function html images input lib listview map mobile module msaccess net number objects open panel pdf picturebox picturebox2 port position print printing problem read regex remove right-to-left save search searchvb.net serial settings shutdown socket sorting sqldatbase sqlserver 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 xml year





