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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top