AddRibbonBar Method
Description
Adds a RibbonBar.
Syntax
Public Function AddRibbonBar( _
ByVal [Name](#) As String _
) As [RibbonBar](XtremeCommandBars~RibbonBar.md)
Parameters
- Name: Title of the Ribbon Bar.
Return Type
Reference to the RibbonBar that was just added.
Remarks
The AddRibbonBar method adds a Ribbon Bar to the command bars. The Ribbon Bar is just a different type of command bar and functions similarly with some added functionality. Finding a control in the Ribbon Bar is done using the FindControl method. The controls in the Ribbon Bar respond exactly the same way they would in a normal toolbar. The Execute event is used when an item is clicked or executed, and the status of items is updated using the Update event.
After adding a RibbonBar, the EnableDocking method should be used to disable docking by using the xtpFlagStretched flag, or by using a zero (0). If docking is desired, the Ribbon Bar can only be docked to the top or bottom of the application.
Call the RecalcLayout method to correctly size the Ribbon Bar when the layout has changed. Layout refers to anything that changes the size of the Ribbon Bar. For example, a layout change that requires the RecalcLayout method to be called would be adding a group, adding an item to a group, changing the caption of a tab, or adding/removing tab icons because the new caption could be smaller or wider.
For visible changes to the Ribbon Bar, such as changing the tab color of a visible tab button, the RedrawBar method is used.
The SetIconSize method sets the size of the "normal" icons displayed in the Ribbon Bar. Icons will not be displayed smaller than the size specified with SetIconSize. If a larger icon has not been added with the specified size, then the closest match will be scaled to the specified size.
The TabCount property returns the total number of tabs that have been added to the tabs collection.
The InsertTab method adds a new RibbonTab to the tabs collection of the Ribbon Bar.
Tabs in the Ribbon Bar contain one or more RibbonGroup objects. Buttons, Popups, etc., can then be added to the groups.
The TabCount property can be used to determine the total number of tabs that have been added.
Each RibbonTab can contain one or more RibbonGroup objects that are used to hold CommandBarControl objects. The Caption of a RibbonGroup is a title bar that visually "groups" the CommandBarControl objects that have been added to the RibbonGroup Items Collection.
Groups are added to the RibbonTab Groups Collection using the AddGroup and InsertGroup methods. Items are added to a group using the Add method.
Methods and Properties unique to the Ribbon Bar are:
- InsertTab and TabPaintManager methods.
- TabCount and Tab properties.
See Also
- CommandBarsFrame Control
- RibbonBar Object
- AddGroup Method
- InsertGroup Method
- RibbonTab Object
- Add Item Method
Example
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.