Category / Section
How to add or remove QAT item through code in WinForms RibbonControlAdv?
1 min read
Add or remove QAT item
To add ToolStripItems to the QAT, RibbonControlAdv.Header.AddQuickItem method can be used.
C#
ToolStripButton toolStripButton = new ToolStripButton(); toolStripButton.Text = this.comboBox1.Text; this.ribbonControlAdv1.Header.AddQuickItem(toolStripButton);
VB
Dim toolStripButton As ToolStripButton = New ToolStripButton() toolStripButton.Text = Me.comboBox1.Text Me.ribbonControlAdv1.Header.AddQuickItem(toolStripButton)
To remove ToolStripItems from the QAT, RibbonControlAdv.Header.QuickItems.RemoveAt method can be used. The index of the item to be removed should be passed to this method.
C#
this.ribbonControlAdv1.Header.QuickItems.RemoveAt(1);
VB
Me.ribbonControlAdv1.Header.QuickItems.RemoveAt(count)