Compartir a través de


Button Class

Definition

Represents a Windows Forms button that can be added to a Microsoft Office Excel worksheet.

public ref class Button : System::Windows::Forms::Button
[System.ComponentModel.DefaultEvent("Click")]
[System.ComponentModel.DefaultProperty("Text")]
[System.ComponentModel.ToolboxItem(false)]
public class Button : System.Windows.Forms.Button
[<System.ComponentModel.DefaultEvent("Click")>]
[<System.ComponentModel.DefaultProperty("Text")>]
[<System.ComponentModel.ToolboxItem(false)>]
type Button = class
    inherit Button
Public Class Button
Inherits Button
Inheritance
Button
Attributes

Remarks

The Microsoft.Office.Tools.Excel.Controls.Button is different from a System.Windows.Forms.Button. The Microsoft.Office.Tools.Excel.Controls.Button has additional members that enable it to be added to an Excel worksheet and that give it additional methods and properties.

Do not use the New constructor to create a new Button. Use the AddButton method to add a new Button to a worksheet.

Properties

AltHTML
Application

Gets an Application object that represents the creator of the Button.

Border

Gets a Border that represents the border of the Button.

Bottom

Gets the distance, in points, between the bottom edge of the Button and the top edge of the worksheet.

BottomRightCell

Gets a Range object that represents the cell that lies under the lower-right corner of the Button.

Creator

Gets a value that indicates the application in which the Button was created.

Height

Gets or sets the height of the Button.

Index

Gets the index number of the Button within the collection of OLEObjects on the sheet.

Interior

Gets an Interior object that represents the interior of the Button.

Left

Gets or sets the distance, in points, between the left edge of the Button and the left edge of the worksheet.

Locked

Gets or sets a value that indicates whether the Button can be modified at design time when the sheet is protected.

OLEType

Gets a value that represents the OLE object type.

OnAction
Parent

Gets the parent object for the Button.

Placement

Gets or sets an object that indicates the way the Button is attached to the cells below it.

PrintObject

Gets or sets a value that indicates whether the Button is printed when the worksheet is printed.

Right

Gets the distance, in points, between the right edge of the Button and the left edge of the worksheet.

ShapeRange

Gets a ShapeRange object that represents the Button.

SourceName

Gets or sets the link source name of the Button.

Top

Gets or sets the distance, in points, between the top edge of the Button and the top edge of the worksheet.

TopLeftCell

Gets a Range object that represents the cell that lies under the upper-left corner of the Button.

Visible

Gets or sets a value that represents whether the Button is visible.

Width

Gets or sets the width of the Button in points.

ZOrder

Gets the z-order position of the Button.

Methods

Activate()

Activates the Button.

BringToFront()

Brings the Button to the front of the z-order.

CopyPicture(XlPictureAppearance, XlCopyPictureFormat)

Copies the Button to the Clipboard as a picture.

Delete()

Deletes a dynamically created Button from the worksheet and removes it from the ControlCollection.

Select(Object)

Selects the Button.

SendToBack()

Sends the Button to the back of the z-order.

SetVisibleCore(Boolean)

Sets the Button to the specified visible state.

Update()

Applies to