StewSupport
asked on
open menu when right click on notifyicon vb.net
how do i open a menu to exit the application when i right click on notifyicon in the systemtray? thanks.
Add a contextmenu to the click handler for the icon.
ASKER
how do i add the context menu to the icon?
Private Sub Icon_MouseUp(ByVal sender As Object, ByVal e As EventArgs) Handles icon.MouseUp
icon.ContextMenu = New ContextMenu
icon.ContextMenu.MenuItems .Add("Clos e", AddressOf YourExitHandler)
End Sub
icon.ContextMenu = New ContextMenu
icon.ContextMenu.MenuItems
End Sub
ASKER
YourExitHandler not sure what this will be please help
Private Sub YourExitHandler(ByVal sender As Object, ByVal e As EventArgs)
Application.Exit()
End Sub
ASKER
that doesn't pop up any menu.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
oh no i meant to give wellhole the point.
ASKER
i sent email to ask if i can reassign point but in case if they don't answer, can i just create new question and just give you the point? thanks.