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 I'm launching frmGame from frmStartup:
dim frmGame as frmGame
frmGame = new frmGame()
frmGame.show
While I'm probably on the wrong path, here's how I've tried closing frmGame from frmStartup:
dim frmGame as new frmGame
frmGame.close (also tried frmGame.dispose)
This doesn't generate an error, however it doesn't close the frmGame that is already open. I'm 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 dim'd frmGame, it reacts the same way as the code above.
Any help would be greatly appreciated.
For what its worth, this is how I'm launching frmGame from frmStartup:
dim frmGame as frmGame
frmGame = new frmGame()
frmGame.show
While I'm probably on the wrong path, here's how I've tried closing frmGame from frmStartup:
dim frmGame as new frmGame
frmGame.close (also tried frmGame.dispose)
This doesn't generate an error, however it doesn't close the frmGame that is already open. I'm 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 dim'd frmGame, it reacts the same way as the code above.
Any help would be greatly appreciated.