Private Sub ContextMenuStrip1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles ContextMenuStrip1.MouseLeave
ContextMenuStrip1.AutoClose = True
ContextMenuStrip1.Close()
End Sub
Private Sub ContextMenuStrip1_Opening(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip1.Opening
ContextMenuStrip1.AutoClose = False
End Sub
Just be sure to set the control's ContextMenu to ContextMenuStrip1 or you have to handle opening it too. Let the OS handle the popup part. The ContextMenuStrip1.AutoClose should be set to True at design time (default).
Enter your message below
Sign in or Join us (it's free).