D
density
Guest
I have a program with 3 forms: frmStartup, frmPlayers, and frmGame. frmStartup is the startup form for the application. frmPlayers is launched from frmStartup and frmGame is launched from frmPlayers. I would like to close frmGame from frmStartup (which is not the form that launched it).
For what its worth, this is how Im launching frmGame from frmStartup:
dim frmGame as frmGame
frmGame = new frmGame()
frmGame.show
While Im probably on the wrong path, heres how Ive tried closing frmGame from frmStartup:
dim frmGame as new frmGame
frmGame.close (also tried frmGame.dispose)
This doesnt generate an error, however it doesnt close the frmGame that is already open. Im guessing it is closing a new instance of frmGame that I created in the dim statement but never showed.
I have also tried:
dim frmGame as frmGame
frmGame.close
This generates an Object reference not set to an instance of the object error.
I also tried putting a public sub in frmGame which contains me.close and calling that sub from frmStartup. Depending on how i dimd frmGame, it reacts the same way as the code above.
Any help would be greatly appreciated.
For what its worth, this is how Im launching frmGame from frmStartup:
dim frmGame as frmGame
frmGame = new frmGame()
frmGame.show
While Im probably on the wrong path, heres how Ive tried closing frmGame from frmStartup:
dim frmGame as new frmGame
frmGame.close (also tried frmGame.dispose)
This doesnt generate an error, however it doesnt close the frmGame that is already open. Im guessing it is closing a new instance of frmGame that I created in the dim statement but never showed.
I have also tried:
dim frmGame as frmGame
frmGame.close
This generates an Object reference not set to an instance of the object error.
I also tried putting a public sub in frmGame which contains me.close and calling that sub from frmStartup. Depending on how i dimd frmGame, it reacts the same way as the code above.
Any help would be greatly appreciated.