Code Question -Second Post

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
 
C

Cor Ligthert [MVP]

Rick,

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

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top