PushButton
Description:
The PushButton object represents an button on a RibbonPanel.
The PushButton object represents an button on a RibbonPanel.
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.PushButton
Autodesk.Revit.UI.ToggleButton
System.Object
Autodesk.Revit.UI.RibbonItem
Autodesk.Revit.UI.RibbonButton
Autodesk.Revit.UI.PushButton
Autodesk.Revit.UI.ToggleButton
public class PushButton : RibbonButton
private void AddPushButton(RibbonPanel panel)
{
PushButton pushButton = panel.AddItem(new PushButtonData("HelloWorld",
"HelloWorld", @"D:\Sample\HelloWorld\bin\Debug\HelloWorld.dll", "HelloWorld.CsHelloWorld")) as PushButton;
// Set ToolTip and contextual help
pushButton.ToolTip = "Say Hello World";
ContextualHelp contextHelp = new ContextualHelp(ContextualHelpType.Url,
"http://www.autodesk.com");
pushButton.SetContextualHelp(contextHelp);
// Set the large image shown on button
pushButton.LargeImage =
new BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\39-Globe_32x32.png"));
}
| 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 |
| Name | Return Type | Description | Inherited From |
|---|---|---|---|
| AssemblyName | string | The assembly path of the button. | |
| AvailabilityClassName | string | The full class name for the class providing the entry point to decide availability of this push button. | |
| ClassName | string | The name of the class containing the implementation for the command. | |
| 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 |