I have a form with a NotifyIcon and a ContextMenuStrip and I want to display the menu by clicking on the notification, but unfortunately it is displayed in the taskbar. Why? I tried setting the ShowInTaskbar property to false, but it didn’t work. Here is my code:
Public Class frmNotificaction
Public WithEvents MyNotify As New NotifyIcon With {.Icon = My.Resources.Icon1}
Dim MyMenu As New ContextMenuStrip
Private Sub frmNotificaction_Load(sender As Object, e As EventArgs) Handles MyBase.Load
MyMenu.Items.Add("Item1")
MyMenu.Items.Add("Item2")
MyNotify.Visible = True
End Sub
Private Sub MyNoti_Click(sender As Object, e As EventArgs) Handles MyNotify.Click
Me.ShowInTaskbar = False
MyMenu.Visible = Not MyMenu.Visible
End Sub
End Class