Code Question -Second Post

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rick@aol.com

    #1

    Code Question -Second Post

    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.EventArg s) Handles MyBase.Load
    NotifyIcon1.Ico n = Me.Icon
    NotifyIcon1.Vis ible = True
    End Sub
    Private Sub NotifyIcon1_Cli ck(ByVal sender As Object, ByVal e As
    System.EventArg s) Handles NotifyIcon1.Dou bleClick, NotifyIcon1.Cli ck
    Me.BringToFront ()
    End Sub



    But this code work

    Private Sub frmExample_Load (ByVal sender As System.Object, ByVal e
    As System.EventArg s) Handles MyBase.Load
    NotifyIcon1.Ico n = Me.Icon
    NotifyIcon1.Vis ible = True
    End Sub
    Private Sub NotifyIcon1_Cli ck(ByVal sender As Object, ByVal e As
    System.EventArg s) Handles NotifyIcon1.Dou bleClick, NotifyIcon1.Cli ck
    Stop
    Me.BringToFront ()
    End Sub

    (Note all I did was add a stop to verify that the event was firing
  • Cor Ligthert [MVP]

    #2
    Re: Code Question -Second Post

    Rick,

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

    Cor

    <Rick@aol.comsc hreef in bericht
    news:5lb5o2lalb b5rh58ure0h3g45 ur7775h1t@4ax.c om...
    >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.EventArg s) Handles MyBase.Load
    NotifyIcon1.Ico n = Me.Icon
    NotifyIcon1.Vis ible = True
    End Sub
    Private Sub NotifyIcon1_Cli ck(ByVal sender As Object, ByVal e As
    System.EventArg s) Handles NotifyIcon1.Dou bleClick, NotifyIcon1.Cli ck
    Me.BringToFront ()
    End Sub
    >
    >
    >
    But this code work
    >
    Private Sub frmExample_Load (ByVal sender As System.Object, ByVal e
    As System.EventArg s) Handles MyBase.Load
    NotifyIcon1.Ico n = Me.Icon
    NotifyIcon1.Vis ible = True
    End Sub
    Private Sub NotifyIcon1_Cli ck(ByVal sender As Object, ByVal e As
    System.EventArg s) Handles NotifyIcon1.Dou bleClick, NotifyIcon1.Cli ck
    Stop
    Me.BringToFront ()
    End Sub
    >
    (Note all I did was add a stop to verify that the event was firing

    Comment

    Working...