SplitButton
Description:
The SplitButton object represents a button with a clickable button appearing above a pulldown.
The SplitButton object represents a button with a clickable button appearing above a pulldown.
Remarks:
Use of this class is not supported in Revit Macros.
Use of this class is not supported in Revit Macros.
Inheritance Hierarchy:
System.Object
Autodesk.Revit.UI.RibbonItem
Autodesk.Revit.UI.RibbonButton
Autodesk.Revit.UI.PulldownButton
Autodesk.Revit.UI.SplitButton
System.Object
Autodesk.Revit.UI.RibbonItem
Autodesk.Revit.UI.RibbonButton
Autodesk.Revit.UI.PulldownButton
Autodesk.Revit.UI.SplitButton
public class SplitButton : PulldownButton
private void AddSplitButton(RibbonPanel panel)
{
string assembly = @"D:\Sample\HelloWorld\bin\Debug\HelloWorld.dll";
// create push buttons for split button drop down
PushButtonData bOne = new PushButtonData("ButtonNameA", "Option One",
assembly, "Hello.HelloOne");
bOne.LargeImage =
new BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\One.bmp"));
PushButtonData bTwo = new PushButtonData("ButtonNameB", "Option Two",
assembly, "Hello.HelloTwo");
bTwo.LargeImage =
new BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\Two.bmp"));
PushButtonData bThree = new PushButtonData("ButtonNameC", "Option Three",
assembly, "Hello.HelloThree");
bThree.LargeImage =
new BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\Three.bmp"));
SplitButtonData sb1 = new SplitButtonData("splitButton1", "Split");
SplitButton sb = panel.AddItem(sb1) as SplitButton;
sb.AddPushButton(bOne);
sb.AddPushButton(bTwo);
sb.AddPushButton(bThree);
}
| Name | Return Type | Description | Inherited From |
|---|---|---|---|
| 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 |
| AddPushButton(PushButtonData) | PushButton | Adds a new pushbutton to the pulldown button and associates it with an ExternalCommand. | PulldownButton |
| AddSeparator() | None | Adds a separator to the drop-down list. | PulldownButton |
| GetItems() | IList<PushButton> | Gets a copy of the collection of buttons assigned to the pulldown button. | PulldownButton |
| Name | Return Type | Description | Inherited From |
|---|---|---|---|
| CurrentButton | PushButton | Gets or sets the current PushButton of the SplitButton. | |
| IsSynchronizedWithCurrentItem | bool | Indicates whether the top PushButton on the SplitButton changes based on the CurrentButton property. | |
| 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 |
| Image | ImageSource | The image of the button. | RibbonButton |
| IsEnabledByContext | bool | Indicates if this button can be executed. True if the pushbutton is permitted to be executed based on the current Revit context (active document, active view and active tool). False if the pushbutton is disabled because of the active context. | RibbonButton |
| LargeImage | ImageSource | The large image shown on the button. | RibbonButton |