The hot item list, which includes a list of items to add to the Quick Access Toolbar at run time, is available at run time by clicking the Quick Access Toolbar's drop-down arrow. Items added to the hot item list at design time appear in the Customize QAT menu at run time:
To Add Hot List Items Using the Smart Designer
Complete the following steps:
- Click the Ribbon item on the Ribbon to enable its floating toolbar.
- Select the +HOT button.
The combo box is added to the hot list.
To Add Hot List Items Programmatically
Note: In the following example embedded resources containing the following images are used: NewBtn.png and OpenBtn.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.
Complete the following steps:
- Add the following code to your project:
To write code in Visual Basic
Visual Basic |
Copy Code
|
Imports C1.Win.C1Ribbon
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' add items to the hot list
Dim RedoFileRibbonBtn As RibbonButton = New RibbonButton()
Dim PrintFileRibbonBtn As RibbonButton = New RibbonButton()
C1Ribbon1.Qat.MenuItems.Add(RedoFileRibbonBtn)
C1Ribbon1.Qat.MenuItems.Add(PrintFileRibbonBtn)
' set some properties for the hot list items
RedoFileRibbonBtn.SmallImage = My.Resources.Resources.redo
RedoFileRibbonBtn.Text = "&Redo"
PrintFileRibbonBtn.SmallImage = My.Resources.Resources.print
PrintFileRibbonBtn.Text = "&Print"
End Sub
|
To write code in C#
C# |
Copy Code
|
// type the using directive for the namespace
using C1.Win.C1Ribbon;
private void Form1_Load(object sender, System.EventArgs e)
{
// add items to the hot list
RibbonButton RedoFileRibbonBtn = new RibbonButton();
RibbonButton PrintFileRibbonBtn = new RibbonButton();
c1Ribbon1.Qat.MenuItems.Add(RedoFileRibbonBtn);
c1Ribbon1.Qat.MenuItems.Add(PrintFileRibbonBtn);
// set some properties for the hot list items
RedoFileRibbonBtn.SmallImage = Properties.Resources.redo;
RedoFileRibbonBtn.Text = "&Redo";
PrintFileRibbonBtn.SmallImage = Properties.Resources.print;
PrintFileRibbonBtn.Text = "&Print";
}
|
- Click the Start Debugging button to run the application and click the QAT drop-down arrow to reveal the list of items in the hot list.
- Select an item from the hot item list to add it to the QAT. The Open and New buttons have been selected in the hot list and added to the QAT:
- To remove the items from the QAT simply deselect each item in the hot list.