Hi. I have a "Sub Main()" that does some work before showing a form
and then a routine to hide the form to the Systray when minimized
The problem is once the Minimize button is pressed, it transfers control back to "Sub Main()" which then ends Sub and thus quits.
Is there I can prevent this from happening without setting the Startup object to "frmGUI?"
Code:
Module modMain
Sub Main()
'some work here
Dim myfrmGUI As New frmGUI
myfrmGUI.ShowDialog()
End Sub
End Module
Code:
Public Class frmGUI
Private Sub frmGUI_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
If Me.WindowState = FormWindowState.Minimized Then
Me.Hide()
End If
End Sub
End Class
Is there I can prevent this from happening without setting the Startup object to "frmGUI?"