Articles in this section
Category / Section

How to trigger when adding or removing Toolbar items event in WinForms RibbonControlAdv?

1 min read

QAT items event

When the QuickAccessToolBar items are added, RibbonControlAdv.Header.QuickItemAdded event will be triggered. Similarly when the QuickAccessToolBar items are removed, RibbonControlAdv.Header.QuickItemRemoved event will be triggered in WinForms Ribbon. Refer to the code snippet given below.

C#

public Form1()
{
    InitializeComponent();
    this.ribbonControlAdv1.Header.QuickItemAdded+=new ToolStripItemEventHandler(Header_QuickItemAdded);
    this.ribbonControlAdv1.Header.QuickItemRemoved += new ToolStripItemEventHandler(Header_QuickItemRemoved);
}
private void Header_QuickItemAdded(object sender, ToolStripItemEventArgs e)
{
    MessageBox.Show(e.Item.Text);
}
private void Header_QuickItemRemoved(object sender, ToolStripItemEventArgs e)
{
    MessageBox.Show(e.Item.Text);
}

VB

Public Sub New()
    InitializeComponent()
    AddHandler ribbonControlAdv1.Header.QuickItemAdded, AddressOf Header_QuickItemAdded
    AddHandler ribbonControlAdv1.Header.QuickItemRemoved, AddressOf Header_QuickItemRemoved
End Sub
Private Sub Header_QuickItemAdded(ByVal sender As Object, ByVal e As ToolStripItemEventArgs)
    MessageBox.Show(e.Item.Text)
End Sub
Private Sub Header_QuickItemRemoved(ByVal sender As Object, ByVal e As ToolStripItemEventArgs)
    MessageBox.Show(e.Item.Text)
End Sub

Conclusion

I hope you enjoyed learning how to triggered when adding or removing Toolbar items event in WinForms RibbonControlAdv.

Refer to our WinForms Ribbon’s feature tour page for its other groundbreaking feature representations. You can also explore our WinForms Ribbon control documentation to understand how to present and manipulate data.

For current customers, check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, try our 30-day free trial to check out our WinForms GridControl and other WinForms components.

Please let us know in the following comment section if you have any queries or require clarifications. Contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied