Home All Groups Group Topic Archive Search About

Code Question -Second Post

Author
15 Dec 2006 2:18 PM
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

Author
16 Dec 2006 12:19 PM
Cor Ligthert [MVP]
Rick,

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

Cor

<R***@aol.com> schreef in bericht
Show quoteHide quote
news:5lb5o2lalbb5rh58ure0h3g45ur7775h1t@4ax.com...
>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