Problem: I want to set the contextmenu for a tray icon of a form so that when you click a menu selection, such as "Click to see form", the form appears, when the selection "Click to minimize form" the form disappears and "Exit", the program closes. I have loaded the form so that it does not appear but the tray icon in seen below. Also, I have the exit part working but again can not effect the appear part and the disappear part ( see below ).
I am trying to create a contextmenu for a tray icon using you example on pages 420, 421 & 422 of Beginning VB
.Net 2nd Edition.
Public Class ExitMenuItem
Public Sub New()
Text = "Exit"
Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
'I want to put some code here to make the form appear, such as
' me.visible = true
' but this code does not work
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
' then, add an exit option...
' finally, tell the tray icon to use this menu...
icnNotify.ContextMenu = menu
I would appreciate some help with this problem.