takowai Posted August 12, 2003 Posted August 12, 2003 I have a problem with three forms - one is the menu for the other two. I can open the other two forms from the Menu but the menu stays in the background. When I close the new form a totally new Menu opens leaving me with three forms on screen etc. I know that there is a way of hiding the Menu or the other forms when I return to the Menu but, try as I might, my screen keeps being populated by these forms. I would appreciate any help that you may be able to give. Thanks. Quote
ThePentiumGuy Posted August 12, 2003 Posted August 12, 2003 ok, opening forms in vb.net is totally different than VB6 u gotta do this: under menuitem1_click: dim mynewform as new form2 mynewform.open or .load - something i dont remember right now 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
takowai Posted August 12, 2003 Author Posted August 12, 2003 That was one of the ways that I tried. I used: Dim FrmMaint As New Maintenance frmMaint.Show() It works but the Menu form is still behind the Maintenance form. How do I hide the Menu form until the Maintenance form is closed? When I close the Maint form (which I have managed) I then need the Maint form to disappear and the Menu form to reappear. At the present time it just stays behind the new Menu form so I have the original Menu, the Maint and then the new Menu in a stack. Quote
ThePentiumGuy Posted August 12, 2003 Posted August 12, 2003 can you attach the project please? then i might be able to help u and understand better 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
takowai Posted August 12, 2003 Author Posted August 12, 2003 I am trying to attach the project but I'm new to this and am having problems - please bear with me!! Quote
Leaders dynamic_sysop Posted August 12, 2003 Leaders Posted August 12, 2003 in form1 : Dim FrmMaint As New Maintenance Me.AddOwnedForm(FrmMaint) frmMaint.Show() Me.Hide() in form2 ( Maintenance ) : Dim frmMain As Form1 = Owner '/// the Menu form Private Sub Form2_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing Owner.Show() '/// show the Menu form again. Me.Close() End Sub Quote
takowai Posted August 12, 2003 Author Posted August 12, 2003 It's no good..... I'm having a blonde day. I'll keep working on it and hope that I can find a way myself. Thanks anyway. Quote
*Experts* mutant Posted August 12, 2003 *Experts* Posted August 12, 2003 dynamic_sysop, dont use Close() method of the form in its closing event, it will cause StackOverflow exception. :) Quote
takowai Posted August 12, 2003 Author Posted August 12, 2003 Hey...after I had given up hope. You're a lifesaver. Thank you. Quote
Winston Posted August 12, 2003 Posted August 12, 2003 dynamic_sysop, dont use Close() method of the form in its closing event, it will cause StackOverflow exception. :) yeah true that isn't the .close statement actually processing all procedures in the form closing event anyways Quote
*Experts* mutant Posted August 12, 2003 *Experts* Posted August 12, 2003 yeah true that isn't the .close statement actually processing all procedures in the form closing event anyways Yeah, Close() raises the Closing event before actually closing the from so you still have a chance to cancel the form closing, or do some cleanup code. Quote
ThePentiumGuy Posted August 13, 2003 Posted August 13, 2003 I am trying to attach the project but I'm new to this and am having problems - please bear with me!! oh sorry.. u need winZIP <http://www.winzip.com> take out the EXE file in the BIN folder so that there will be no viruses(or something like that :rolleyes: ) anyway u got your problems fixed right? 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
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.