Who can help me set up a tray icon contextmenu ??????????????

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

Can somebody help me creat a tray icon contextmenu, so when you right click the icon the
menu appears. Also, when an item is clicked on the menu,
the tray icon's form will appear or disappear

I have the following code for the problem but it does not seem to do much

thanks

Bruc

Sub Createcontextmenu(

Dim ctx As New ContextMenu(

With ctx.MenuItem
.Add(New MenuItem("Click to Restore Form", AddressOf icnContext_Click)
.Add(New MenuItem("Click to Minimize Form", AddressOf icnContext_Click)
.Add(New MenuItem("Exit", AddressOf icnContext_Click)

End Wit

icnContext.ContextMenu = ct

End Su


Private Sub icnContext_Click(ByVal sender As Object, ByVal e As System.EventArgs)

Dim mi As MenuItem = DirectCast(sender, MenuItem

Select Case mi.Tex

Case "Click to Restore Form
Me.Visible() = Tru
Case "Click to Minimize Form
Me.Visible() = Fals
Case "Exit
Me.Close(

End Selec



End Su
End Clas
 
Back
Top