Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

"Reality is fake, Dreams are for real"
  • Leaders
Posted

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()

Posted
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.
Gamer extraordinaire. Programmer wannabe.
Posted

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:

"Reality is fake, Dreams are for real"
Posted
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 :)
"Reality is fake, Dreams are for real"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...