-
Notification Icon
I can create a notification icon to appear in the Systray, but how do I hide the Icon when the form is showing, show the icon but hide the form when minimized, create a menu on right clicking the icon, and be able to activate the chosen menu item on the notification icon?
Could someone possible point me in the right direction?
Thanks.
-
I have this in one of my apps, there is some junk depending on what culture info we use, because its built for the swedish market. But I think you can filter out how its done....
Code:
With niFrontend
.Visible = True
Dim ci As System.Globalization.CultureInfo = System.Globalization.CultureInfo.CurrentCulture
Dim mnu(1) As MenuItem
If Strings.Left(ci.Name, 2) = "en" Then
mnu(0) = New MenuItem("Tools...", New EventHandler(AddressOf Me.btnTools_Click))
mnu(1) = New MenuItem("Quit", New EventHandler(AddressOf Me.btnClose_Click))
Else
mnu(0) = New MenuItem("Verktyg...", New EventHandler(AddressOf Me.btnTools_Click))
mnu(1) = New MenuItem("Avsluta", New EventHandler(AddressOf Me.btnClose_Click))
End If
Dim niMenu As New ContextMenu(mnu)
.ContextMenu = niMenu
End With
If you have added your contextmenu at designtime you wouldn't have to do any of this but only to set the contextmenu property of your notification menu to the added context menu.
-
Thanks, where would I put this?
-
I had it in the load event of the main form.
-
Thanks Athley, I have most of it worked out, just a few questions:
1/. How do I hide the icon when the form is on show?
2/. How do I make the icon visible when the user minimizes the form?
3/. How do I hide the from completely when minimized?
:D