English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm trying to make a program for an online game i play to show the world map. It opens the first form with the main map and I want to be ablke to click on an image of say, an arrow, to go to the right. I made another form with what would be to the right but i can't figure out how to load that second form and get rid of the first one. any help appreciated. thanks.

2007-02-27 11:47:23 · 3 answers · asked by cyclones_rul 3 in Computers & Internet Programming & Design

3 answers

(VB5/6) A simple way would be:

button_click() 'whatever you named the event button
form1.hide
form2.show

end sub

Change the form names to whatever you named them.

2007-02-27 11:59:44 · answer #1 · answered by steve.c_50 6 · 0 0

Do a .Hide and .Show to your two forms as another poster has already explained.

If you want the first form to still exist, but not be clickable, then when you do a .Show on the second form, add vbModal to the end, which means that the first one won't be clickable until the second form closes.

Hope this helps, best of luck to your project!

2007-02-27 12:02:49 · answer #2 · answered by Anonymous · 0 0

OK; first I asume you created a form class like this:

class Form1: Inherits System.Windows.Forms.Form
public sub new()
Me.size=new Size(400,400)
Me.FormBorderStyle = FormBorderStyle.None
Me.StartPosition=FormStartPosition.CenterScreen
Me.ShowDialog()
end sub
end class

Then you create
class Form2: Inherits System.Windows.Forms.Form
public sub new()
Me.size=new Size(400,400)
Me.FormBorderStyle = FormBorderStyle.None
Me.StartPosition=FormStartPosition.CenterScreen
Me.ShowDialog()
end sub
end class

Then you instantiate Form1: dim f1= New Form1()
And when you want to get rid of this use this code:

f1.close()
then you show the second form:
dim f2= New Form2()

I hope it helps!

2007-02-27 12:17:56 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers