D
Derek Martin
Hi there, this is probably really dumb, but I am using a dialog as my main
form and my startup form is my splash screen - which implements some
progress bars to load up some relevant data. When that is done, loading
form does this:
Me.Visible = False
mainform.ShowDialog()
Application.Exit()
So far so good (is this a dumb way of doing that???). Now, I am
implementing a notification icon in mainform. Here is some relevant stuff:
(class variable shown as boolean = true and notify icon set up correctly)
Private Sub Open_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles NotifyIcon1.DoubleClick
Me.WindowState = FormWindowState.Normal
Me.ShowInTaskbar = True
shown = True
NotifyIcon1.Visible = False
End Sub
Private Sub MainFormSizeChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.SizeChanged
If shown And Me.WindowState = FormWindowState.Minimized Then
shown = False
Me.ShowInTaskbar = False
NotifyIcon1.Visible = True
End If
End Sub
Here is the problem: When I hit the ol minimize button on mainform, the
application control is passed back to loading and the application exits
since that is the next line. What am I doing wrong/what can I adjust so
that control doesn't go back to loading when the form is minimized??
Plus, any tips on making that better are certainly welcome!
Thanks!
form and my startup form is my splash screen - which implements some
progress bars to load up some relevant data. When that is done, loading
form does this:
Me.Visible = False
mainform.ShowDialog()
Application.Exit()
So far so good (is this a dumb way of doing that???). Now, I am
implementing a notification icon in mainform. Here is some relevant stuff:
(class variable shown as boolean = true and notify icon set up correctly)
Private Sub Open_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles NotifyIcon1.DoubleClick
Me.WindowState = FormWindowState.Normal
Me.ShowInTaskbar = True
shown = True
NotifyIcon1.Visible = False
End Sub
Private Sub MainFormSizeChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.SizeChanged
If shown And Me.WindowState = FormWindowState.Minimized Then
shown = False
Me.ShowInTaskbar = False
NotifyIcon1.Visible = True
End If
End Sub
Here is the problem: When I hit the ol minimize button on mainform, the
application control is passed back to loading and the application exits
since that is the next line. What am I doing wrong/what can I adjust so
that control doesn't go back to loading when the form is minimized??
Plus, any tips on making that better are certainly welcome!
Thanks!