G
Guest
I have a startup form called frmStartup. It runs code and then calls another frmApp. I will never return to the frmStartup. I use the following code to exit the entire application fom within frmApp
Private Sub frmHorizontal_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPres
If e.KeyChar = Microsoft.VisualBasic.ChrW(122) The
'Dim frmStartup As New Startu
'frmStartup.Close(
Me.Close(
End I
End Su
As you can see, I have tried a few things to get the frmStartup to close when the frmApp closes but haven't had any luck yet. I could also close frmStartup when I load frmApp but since the code is probably identical I haven't got that to work either. What am I missing here. This has to be simple. I don't understand why if I uncomment the two lines above, it doesn't work
Any ideas
John
Private Sub frmHorizontal_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPres
If e.KeyChar = Microsoft.VisualBasic.ChrW(122) The
'Dim frmStartup As New Startu
'frmStartup.Close(
Me.Close(
End I
End Su
As you can see, I have tried a few things to get the frmStartup to close when the frmApp closes but haven't had any luck yet. I could also close frmStartup when I load frmApp but since the code is probably identical I haven't got that to work either. What am I missing here. This has to be simple. I don't understand why if I uncomment the two lines above, it doesn't work
Any ideas
John