Diablicolic Posted August 20, 2003 Posted August 20, 2003 Well I have this form, and when I click on New Game, that form is suppose to close (so I don't have to worry about RAM overdose) and then open the New World Form (Form2)....weeeell...I don't know how to close Form1 after I open the New World Form :mad: Private Sub JustbtnNeww_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click System.Threading.Thread.Sleep(2000) Dim Form2 As New World() Form2.Show() Me.Close() End Sub Quote "Reality is fake, Dreams are for real"
Leaders dynamic_sysop Posted August 20, 2003 Leaders Posted August 20, 2003 the best way would be to start your application from a Sub main() in a module maybe. if you close form1 ( and thats your starting form / parent ) it will kill the app. if you want to use form1 as the start up method ( ie: Sub New() ) then you are going to have to use Form1.Hide() , not Form1.Close() Quote
wyrd Posted August 20, 2003 Posted August 20, 2003 You may want to redesign your World so it's a custom control rather then a form. That way when a new World loads up, all you have to do is replace the instance of your custom control with a new one, and you won't have to do all the form creating and closing. Quote Gamer extraordinaire. Programmer wannabe.
Diablicolic Posted August 20, 2003 Author Posted August 20, 2003 What type of control are you talking about? :( Quote "Reality is fake, Dreams are for real"
wyrd Posted August 20, 2003 Posted August 20, 2003 A custom control.. one that you make yourself. Quote Gamer extraordinaire. Programmer wannabe.
Diablicolic Posted August 21, 2003 Author Posted August 21, 2003 But how do you make custom controls?! rofl :) But seriously...... I tried another way around that big block, instead I'm going to Open the Form2 as the beginning form, and at start up, I'm going to hide Form2: Me.Hide Then show Form1: Dim Form11 As New Form1 Form11.Show The Me.Hide doesn't work though, because both forms show up, why?! :mad: Quote "Reality is fake, Dreams are for real"
*Experts* mutant Posted August 21, 2003 *Experts* Posted August 21, 2003 If you are trying to hide the first form from the Load event then it will be shown again because the form is displayed after the Load. Quote
Diablicolic Posted August 21, 2003 Author Posted August 21, 2003 Oohhh dangit, cool, so what I'm going to do is have on the load a timer enabled to time like 1 second or less..or something like that. Thanks for the info Mutant :) Quote "Reality is fake, Dreams are for real"
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.