Question make contextmenustrip still visible while we are clicking other control?

andimanro

Member
Joined
Jun 7, 2010
Messages
18
Programming Experience
1-3
dear all..

is it possible to make a contextmenustrip still visible while we are clicking other control ? thnx
:cool:
 
Try using the "AutoClose" property on the ContextMenuStrip.

-Josh
 
After a little more checking, I found out that setting the AutoClose property to false also disables the auto showing. So here's what seemed to work for me, just replace the form1 and Me with the control that has the contextmenustrips name.

VB.NET:
 Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
        If e.Button = Windows.Forms.MouseButtons.Right Then
            Dim NewContext As ContextMenuStrip = ContextMenuStrip1
            Me.ContextMenuStrip = NewContext
            Me.ContextMenuStrip.Show(Me, New Point(e.X, e.Y))
        End If
    End Sub

Hope this helps,
-Josh
 
:) Silly me, should have thought of that. Works like a charm!

VB.NET:
Private Sub ContextMenuStrip1_Closing(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripDropDownClosingEventArgs) Handles ContextMenuStrip1.Closing
  e.Cancel = True
End Sub
 
Never close? :)
 
Well I figured that he could come up with the rest :)
 
Back
Top