Hi guys,
I got my app' to minimize to the tray ok that was easy enuff and I've got a doubleclick event for the trayicon to restore the form using windowstate.normal and this was all working fine.
Now I've added a couple of lines of code so that when the form is open form1.showintaskbar = true and trayicon.visible = false and then when the form gets minimized form1.showintaskbar = false and trayicon.visible = true.
The problem I'm having since I made these changes is that double clicking on the trayicon restores the app' but only to the taskbar and assumes that as being its 'normal' state. The only way I can see the form after that is to maximize it.
Can't find anything about this specific prob' on the forums or on the MSDN examples or the Forms FAQ.
Anyway here's the code...
Cheers,
Andy!
I got my app' to minimize to the tray ok that was easy enuff and I've got a doubleclick event for the trayicon to restore the form using windowstate.normal and this was all working fine.
Now I've added a couple of lines of code so that when the form is open form1.showintaskbar = true and trayicon.visible = false and then when the form gets minimized form1.showintaskbar = false and trayicon.visible = true.
The problem I'm having since I made these changes is that double clicking on the trayicon restores the app' but only to the taskbar and assumes that as being its 'normal' state. The only way I can see the form after that is to maximize it.
Can't find anything about this specific prob' on the forums or on the MSDN examples or the Forms FAQ.
Anyway here's the code...
Visual Basic:
Private Sub TrayIcon_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrayIcon.DoubleClick
Me.ShowInTaskbar = True
TrayIcon.Visible = False
Me.WindowState = FormWindowState.Normal
Me.Activate()
End Sub
Private Sub Form1_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
If Me.WindowState = FormWindowState.Minimized Then
Me.ShowInTaskbar = False
TrayIcon.Visible = True
End If
End Sub
Cheers,
Andy!