where is your add handler at? in the load? does it depend on another event
happening first? compare it to the sample code from MSDN
' Initalize the NofifyIcon object's shortcut menu.
Private Sub InitializeConte xtMenu()
Dim menuList() As MenuItem = New MenuItem() _
{New MenuItem("Sign In"), New MenuItem("Get Help"), _
New MenuItem("Open" )}
Dim clickMenu As New ContextMenu(men uList)
NotifyIcon1.Con textMenu = clickMenu
End Sub
' When user clicks the left mouse button display the shortcut menu.
' Use the SystemInformati on.PrimaryMonit orMaximizedWind owSize property
' to place the menu at the lower corner of the screen.
Private Sub NotifyIcon1_Cli ck(ByVal sender As Object, _
ByVal e As System.EventArg s) Handles NotifyIcon1.Cli ck
Dim windowSize As System.Drawing. Size = _
SystemInformati on.PrimaryMonit orMaximizedWind owSize
Dim menuPoint As System.Drawing. Point = New System.Drawing. Point _
(windowSize.Wid th - 180, windowSize.Heig ht - 5)
menuPoint = Me.PointToClien t(menuPoint)
NotifyIcon1.Con textMenu.Show(M e, menuPoint)
End Sub
<no****@meatonc onsulting.comwr ote in message
news:11******** *************@q 40g2000cwq.goog legroups.com...
>I am using VB Net 2005 and want to use the notifyicon. I do not have a
form, only a class. I have no problems showing or modifying the
NotifyIcon, however, I am having a problem handling the click event. I
have tried unsuccessfully using AddHandler:
AddHandler nIcon.Click AddressOf nIcon_Click
Private Sub nIcon_Click(ByV al sender As Object, ByVal e As EventArgs)
MsgBox("Click")
End Sub
Any help would be greatly appreciated.