0

I have a double click event for a notify icon that will bring up my main form. The double click event isnt firing. Even if I put a breakpoint in the code it never gets executed. Here is what I have so far:

 Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing
    Me.WindowState = FormWindowState.Minimized
    Me.Visible = False
    NotifyIcon1.Visible = True
    e.Cancel = True

End Sub

Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick

    Me.Visible = True
    Me.WindowState = FormWindowState.Normal
    Me.Activate()
    Me.BringToFront()
    Me.Focus()
    Me.Show()


End Sub

The excessive stuff is my way of trying eveything I can think of to get the form to show.

thanks in advance.

Sean P
  • 949
  • 4
  • 22
  • 41
  • Did you subscribe properly to DoubleClick event? Does program enter the DoubleClick handler if NotifyIcon1 is always visible? – Alex F Mar 01 '10 at 19:00
  • I did double check that it was subscribed properly and it is. I went to the events, double clicked the double-click option and it brought me to that sub. When I put a breakpoint inside the sub it never gets triggered. – Sean P Mar 01 '10 at 19:04
  • I created a new program and just made a notify icon and used the code above and it works...so what am I missing or doing in my project that would kill this? – Sean P Mar 01 '10 at 19:34
  • Create NotifyICon object in App.xaml.cs so it i will handle click or doubleClick for entire app. – Ashish-BeJovial Sep 15 '15 at 05:01

1 Answers1

0

This is working when I just have a notifyicon in an app all by its self. So what I do with the notifyicon works. What else could be wrong??

Sean P
  • 949
  • 4
  • 22
  • 41