ComponentOne Ribbon for WinForms
Adding Items to the Quick Access Toolbar
C1Ribbon (Classic) Task-Based Help > Adding Ribbon Items > Adding Items to the Quick Access Toolbar

The Quick Access Toolbar (QAT) can grow to accommodate as many commands as needed. To add items to the QAT, use the smart designer or add code. Each option is described below.

To Add QAT Items Using the Smart Designer

Complete the following steps:

  1. Click the Ribbon item on the Ribbon to enable its floating toolbar.
  2. Select the +QAT button.

    The combo box is added to the QAT. You can remove the item from the QAT by selecting the combo box item, which enables the floating toolbar. Select the –QAT button:

To Add QAT Items Programmatically

Note: In the following example embedded resources containing the following images are used: save.png, undo.png, and repeat.png. To embed a resource, from the Project menu, choose YourProjectName Properties. From the Resources tab, select Add Resource and choose to add an existing file or add a new one.

To add Ribbon items (for example, Save, Undo, and Repeat) to the QAT, add the following code to your project:

To write code in Visual Basic

Visual Basic
Copy Code
' include the Imports directive for the namespace
Imports C1.Win.C1Ribbon
 
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    C1Ribbon1.Qat.Items.Add(New RibbonButton(My.Resources.Resources.save))
    C1Ribbon1.Qat.Items.Add(New RibbonButton(My.Resources.Resources.undo))
    C1Ribbon1.Qat.Items.Add(New RibbonButton(My.Resources.Resources.repeat))
End Sub

To write code in C#

C#
Copy Code
// include the using directive for the namespace
using C1.Win.C1Ribbon;
 
private void Form1_Load(object sender, System.EventArgs e)
{
    C1Ribbon1.Qat.Items.Add (new RibbonButton (Properties.Resources.save));
    C1Ribbon1.Qat.Items.Add (new RibbonSplitButton (Properties.Resources.undo));
    C1Ribbon1.Qat.Items.Add (new RibbonButton (Properties.Resources.repeat));
}