)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to display the MiniToolBar and ContextMenu controls at the same time?

Platform: WinForms |
Control: MiniToolBar |
Published Date: November 26, 2015 |
Last Revised Date: January 6, 2020

Show MiniToolBar and ContextMenuStripEx

You can show the MiniToolBar and ContextMenuStripEx at the same by following the below steps.

1)Need to show the ContextMenuStripEx, on MouseDown event.

2)Need to update the visibility of MiniToolBar in required location.

3)Need to enable the visibility of the MiniToolBar, in “Opened” event in ContextMenuStripEx.

 

The following code example demonstrates the same.

C#

void richTextBox1_MouseDown(object sender, MouseEventArgs e)
{
    //To show the context Menu
    this.contextMenuStripEx1.Show(Cursor.Position);
    //To hide the MiniToolBar
    this.miniToolBar1.Visible = false;
    //To show the MiniToolBar with specified location.
    this.miniToolBar1.Show(PointToScreen(e.Location), ToolStripDropDownDirection.AboveLeft);
}
void contextMenuStripEx1_Opened(object sender, EventArgs e)
{
    //To show the MiniToolBar
    this.miniToolBar1.Visible = true;
}

VB

Private Sub richTextBox1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
    'To show the context Menu
    Me.contextMenuStripEx1.Show(Cursor.Position)
    'To hide the MiniToolBar
    Me.miniToolBar1.Visible = False
    'To show the MiniToolBar with specified location.
    Me.miniToolBar1.Show(PointToScreen(e.Location), ToolStripDropDownDirection.AboveLeft)
End Sub
Private Sub contextMenuStripEx1_Opened(ByVal sender As Object, ByVal e As EventArgs)
    'To show the MiniToolBar
    Me.miniToolBar1.Visible = True
End Sub

MiniToolBar and ContextMenuStripEx shows on same time

Figure 1. MiniToolBar and ContextMenuStripEx shows on same time.

Samples:

C#: MiniToolBar_ContextMenuStripEx_C#

VB: MiniToolBar_ContextMenuStripEx_VB

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon