Code Question -Second Post

  • Thread starter Thread starter Rick
  • Start date Start date
R

Rick

I am trying to creat an notification icon that will bring my form to
the foreground. Why does this code not work

Private Sub frmExample_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Load
NotifyIcon1.Icon = Me.Icon
NotifyIcon1.Visible = True
End Sub
Private Sub NotifyIcon1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles NotifyIcon1.DoubleClick, NotifyIcon1.Click
Me.BringToFront()
End Sub



But this code work

Private Sub frmExample_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Load
NotifyIcon1.Icon = Me.Icon
NotifyIcon1.Visible = True
End Sub
Private Sub NotifyIcon1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles NotifyIcon1.DoubleClick, NotifyIcon1.Click
Stop
Me.BringToFront()
End Sub

(Note all I did was add a stop to verify that the event was firing
 
Rick,

I did not try it, but with your stop you give in my idea focus to the IDE.

Cor
 
Back
Top