Code Question

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

    #1

    Code Question

    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
Working...