RadioButtonGroup
Description:
Represents a group of related buttons in the Ribbon.
Represents a group of related buttons in the Ribbon.
Remarks:
This class contains a collection of ToggleButtons. Only one of the ToggleButtons will appear active at a given time. When a different button is clicked in the UI the current ToggleButton will be changed, and the ToggleButton's external command will be invoked. Use of this class is not supported in Revit Macros.
This class contains a collection of ToggleButtons. Only one of the ToggleButtons will appear active at a given time. When a different button is clicked in the UI the current ToggleButton will be changed, and the ToggleButton's external command will be invoked. Use of this class is not supported in Revit Macros.
Inheritance Hierarchy:
System.Object
Autodesk.Revit.UI.RibbonItem
Autodesk.Revit.UI.RadioButtonGroup
System.Object
Autodesk.Revit.UI.RibbonItem
Autodesk.Revit.UI.RadioButtonGroup
public class RadioButtonGroup : RibbonItem
private void AddRadioGroup(RibbonPanel panel)
{
// add radio button group
RadioButtonGroupData radioData = new RadioButtonGroupData("radioGroup");
RadioButtonGroup radioButtonGroup = panel.AddItem(radioData) as RadioButtonGroup;
// create toggle buttons and add to radio button group
ToggleButtonData tb1 = new ToggleButtonData("toggleButton1", "Red");
tb1.ToolTip = "Red Option";
tb1.LargeImage = new BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\Red.bmp"));
ToggleButtonData tb2 = new ToggleButtonData("toggleButton2", "Green");
tb2.ToolTip = "Green Option";
tb2.LargeImage = new BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\Green.bmp"));
ToggleButtonData tb3 = new ToggleButtonData("toggleButton3", "Blue");
tb3.ToolTip = "Blue Option";
tb3.LargeImage = new BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\Blue.bmp"));
radioButtonGroup.AddItem(tb1);
radioButtonGroup.AddItem(tb2);
radioButtonGroup.AddItem(tb3);
}
| Name | Return Type | Description | Inherited From |
|---|---|---|---|
| AddItem(ToggleButtonData) | ToggleButton | Adds a new ToggleButton to the RadioButtonGroup. | |
| AddItems(IList<ToggleButtonData>) | IList<ToggleButton> | Adds new ToggleButtons to the RadioButtonGroup. | |
| GetItems() | IList<ToggleButton> | Gets the collection of ToggleButtons assigned to the RadioButtonGroup. | |
| Equals(Object) | bool | Determines whether the specified is equal to the current . | RibbonItem |
| GetContextualHelp() | nullNothingnullptr | Gets the contextual help bound with this control. | RibbonItem |
| SetContextualHelp(ContextualHelp) | None | Sets the contextual help bound with this button. | RibbonItem |
| Name | Return Type | Description | Inherited From |
|---|---|---|---|
| Current | ToggleButton | Gets or sets the current checked ToggleButton of the RadioButtonGroup. | |
| Enabled | bool | Gets or sets a value indicating whether the item is enabled. | RibbonItem |
| ItemText | string | Gets or sets the text displayed on the item. | RibbonItem |
| ItemType | RibbonItemType | Gets the item type. | RibbonItem |
| LongDescription | string | Long description of the command tooltip | RibbonItem |
| Name | string | The name of the item. | RibbonItem |
| ToolTipImage | ImageSource | The image to show as a part of the button extended tooltip | RibbonItem |
| ToolTip | string | The description that appears as a ToolTip for the item. | RibbonItem |
| Visible | bool | Gets or sets a value indicating whether the item is visible. | RibbonItem |