Question Multiple forms causing problems

samcp16

Member
Joined
Jan 27, 2012
Messages
8
Programming Experience
1-3
Hello, im trying to create a main menu for my game im creating using multiple forms and a button on each form to switch, i manage to get the forms to switch back and forth but when switching to the form that the game is displayed on, the key presses im using to control the avatar stop working (and continue to not function even when the main menu form is removed, resulting in me having to load a back up copy), here is the code im using in each button click.


Dim SecondForm As New Form1
SecondForm.Show()
Me.Hide

Dim SecondForm As New Form2
SecondForm.Show()
Me.Hide



 
If you don't intend to have multiple instances of the forms active at the same time I'd say use the default form instances. Form1.Show() etc.
 
I also tried what you suggested before but the same thing happened, it just wont let me use any key presses, other than that it works so im quite puzzled to be honest, could it be that the first form isn't closed but only hidden and its interfering with the form the game is running on? (I have also tried form1.close but there is still the same error)


Thanks for your help
 

Latest posts

Back
Top