tehon3299 Posted March 26, 2003 Posted March 26, 2003 How can I show another form in my program? I.E. I am in frmMain and want to show frmTest and hide frmMain. Quote Thanks, Tehon
bpayne111 Posted March 26, 2003 Posted March 26, 2003 Dim myForm as New frmTest myForm.Show Me.Hide Quote i'm not lazy i'm just resting before i get tired.
tehon3299 Posted March 26, 2003 Author Posted March 26, 2003 Oh yeah...forgot about having to declare new forms in .NET. Thanks Quote Thanks, Tehon
tehon3299 Posted March 26, 2003 Author Posted March 26, 2003 How do you handle the click of the "x" in the top corner to close the application? How do you unload the application? I can do it with a button click but how do I do it with the "x"? Quote Thanks, Tehon
Cywizz Posted March 26, 2003 Posted March 26, 2003 Your application will automatically close when you click on the "x" on the form. Have you created your own form, with your own "x"? Quote Howzit??
tehon3299 Posted March 26, 2003 Author Posted March 26, 2003 No, I haven't but something must still be open. How do you close a form when a button is clicked? In VB6 I used Unload Me but in .NET you can't. What should i be doing? Quote Thanks, Tehon
bpayne111 Posted March 26, 2003 Posted March 26, 2003 Me.Close Quote i'm not lazy i'm just resting before i get tired.
*Gurus* divil Posted March 26, 2003 *Gurus* Posted March 26, 2003 If you have used Application.Run() with no arguments to start a message loop for your program, you will need to manually call Application.Exit() when all your forms are closed and you are ready to terminate. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Leaders dynamic_sysop Posted March 26, 2003 Leaders Posted March 26, 2003 if you want the whole application to close then use this... Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed End End Sub if you want to unload just the 1 form then i'd use the way of showing the form as divil showed above "Dim frm as form" then i'd do something like... Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed Set frm = nothing End Sub Quote
ThePentiumGuy Posted June 9, 2003 Posted June 9, 2003 [vB]Dim myForm as New frmTest myForm.Show Me.Hide [/vB] Whats the name of the new form, myForm or frmTest? im confused :confused: or do u use MyForm to refer to frmTest? Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
iebidan Posted June 9, 2003 Posted June 9, 2003 Dim myForm as FrmTest = New FrmTest myForm is the name of a variable (container) for your form, FrmTest is the name of the class of your Form, New FrmTest in to create a new instance of the class (form) inside the container, in this case myForm Quote Fat kids are harder to kidnap
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.