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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to load custom controls in MiniToolBar?

Platform: WinForms |
Control: MiniToolBar

Load custom controls

You can load custom controls in MiniToolBar by following the steps.

1)Need to add the ToolStripPanelItem in MiniToolBar Items Collection Editor, as shown in below image.


Item Collection Editor for MiniToolBar

Figure 1. Item Collection Editor for MiniToolBar.

2)Need to host Custom control as ToolStripItem and add it in ToolStripPanelItem.

3)Need to add the ToolStripPanelItem in MiniToolBar.

4)Specify the associated control for MiniToolBar.


The following code example demonstrates the same.


//Initialize the ToolStripPanelItem
Syncfusion.Windows.Forms.Tools.ToolStripPanelItem toolStripPanelItem1 = new Syncfusion.Windows.Forms.Tools.ToolStripPanelItem();
//To add the ToolStripPanelItem in MiniToolBar
this.miniToolBar1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {this.toolStripPanelItem1});
//To load custom controls in MiniToolBar.
toolStripPanelItem1.Items.Add(new ToolStripControlHost(this.integerTextBox1));
//To load custom controls in MiniToolBar.
this.toolStripPanelItem1.Items.Add(new ToolStripControlHost(this.integerTextBox1));
//To specify the associated control with MiniToolBar
this.miniToolBar1.AssociatedControl = this.richTextBox1;


'Initialize the ToolStripPanelItem
Dim toolStripPanelItem1 As Syncfusion.Windows.Forms.Tools.ToolStripPanelItem = New Syncfusion.Windows.Forms.Tools.ToolStripPanelItem
'To add the ToolStripPanelItem in MiniToolBar
Me.miniToolBar1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripPanelItem1})
'To load custom controls in MiniToolBar.
toolStripPanelItem1.Items.Add(New ToolStripControlHost(Me.integerTextBox1))
'To load custom controls in MiniToolBar.
Me.toolStripPanelItem1.Items.Add(New ToolStripControlHost(Me.integerTextBox1))
'To specify the associated control with MiniToolBar
Me.miniToolBar1.AssociatedControl = Me.richTextBox1


Custom controls loaded in MiniToolBar

Figure 2. Custom controls loaded in MiniToolBar.


C#: MiniToolBar_CustomControl_C#

VB: MiniToolBar_CustomControl_VB

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
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