The PushButton object represents an button on a RibbonPanel.
Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 20.0.0.0 (20.0.0.377)
Syntax
C# |
---|
public class PushButton : RibbonButton |
Visual Basic |
---|
Public Class PushButton _ Inherits RibbonButton |
Visual C++ |
---|
public ref class PushButton : public RibbonButton |
Remarks
Use of this class is not supported in Revit Macros.
Examples

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")); }

Private Sub AddPushButton(panel As RibbonPanel) Dim pushButton As PushButton = TryCast(panel.AddItem(New PushButtonData("HelloWorld", "HelloWorld", "D:\Sample\HelloWorld\bin\Debug\HelloWorld.dll", "HelloWorld.CsHelloWorld")), PushButton) ' Set ToolTip and contextual help pushButton.ToolTip = "Say Hello World" Dim contextHelp As 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")) End Sub
Inheritance Hierarchy
System..::..Object
Autodesk.Revit.UI..::..RibbonItem
Autodesk.Revit.UI..::..RibbonButton
Autodesk.Revit.UI..::..PushButton
Autodesk.Revit.UI..::..ToggleButton
Autodesk.Revit.UI..::..RibbonItem
Autodesk.Revit.UI..::..RibbonButton
Autodesk.Revit.UI..::..PushButton
Autodesk.Revit.UI..::..ToggleButton