Button 类

定义

表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体按钮。Represents a Windows Forms button that can be added to a Microsoft Office Excel worksheet.

[System.ComponentModel.DefaultEvent("Click")]
[System.ComponentModel.DefaultProperty("Text")]
[System.ComponentModel.ToolboxItem(false)]
public class Button : System.Windows.Forms.Button
继承
Button
属性

注解

Microsoft.Office.Tools.Excel.Controls.Button 不同 System.Windows.Forms.ButtonThe Microsoft.Office.Tools.Excel.Controls.Button is different from a System.Windows.Forms.Button. Microsoft.Office.Tools.Excel.Controls.Button具有其他成员,使其能够添加到 Excel 工作表,并为其提供附加方法和属性。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.

不要使用 New 构造函数来创建新的 ButtonDo not use the New constructor to create a new Button. 使用 AddButton 方法将新添加 Button 到工作表中。Use the AddButton method to add a new Button to a worksheet.

属性

AltHTML
Application

获取一个 Application 对象,该对象表示 Button 的创建者。Gets an Application object that represents the creator of the Button.

Border

获取一个表示 Border 的边框的 ButtonGets a Border that represents the border of the Button.

Bottom

获取 Button 的下边缘与工作表的上边缘之间的距离(以磅为单位)。Gets the distance, in points, between the bottom edge of the Button and the top edge of the worksheet.

BottomRightCell

获取一个 Range 对象,该对象表示位于 Button 右下角下面的单元格。Gets a Range object that represents the cell that lies under the lower-right corner of the Button.

Creator

获取一个值,该值指示在其中创建 Button 的应用程序。Gets a value that indicates the application in which the Button was created.

Height

获取或设置 Button 的高度。Gets or sets the height of the Button.

Index

获取 Button 在工作表上的 OLEObjects 集合内的索引号。Gets the index number of the Button within the collection of OLEObjects on the sheet.

Interior

获取一个 Interior 对象,该对象表示 Button 的内部。Gets an Interior object that represents the interior of the Button.

Left

获取或设置 Button 的左边缘与工作表的左边缘之间的距离(以磅为单位)。Gets or sets the distance, in points, between the left edge of the Button and the left edge of the worksheet.

Locked

获取或设置一个值,该值指示当工作表受保护时,在设计时能否修改 ButtonGets or sets a value that indicates whether the Button can be modified at design time when the sheet is protected.

OLEType

获取表示 OLE 对象类型的值。Gets a value that represents the OLE object type.

OnAction
Parent

获取 Button 的父对象。Gets the parent object for the Button.

Placement

获取或设置一个对象,该对象指示 Button 附加到其下面的单元格的方式。Gets or sets an object that indicates the way the Button is attached to the cells below it.

PrintObject

获取或设置一个值,该值指示打印工作表时,是否打印 ButtonGets or sets a value that indicates whether the Button is printed when the worksheet is printed.

Right

获取 Button 的右边缘与工作表的左边缘之间的距离(以磅为单位)。Gets the distance, in points, between the right edge of the Button and the left edge of the worksheet.

ShapeRange

获取一个表示 ShapeRangeButton 对象。Gets a ShapeRange object that represents the Button.

SourceName

获取或设置 Button 的链接源名称。Gets or sets the link source name of the Button.

Top

获取或设置 Button 的上边缘与工作表的上边缘之间的距离(以磅为单位)。Gets or sets the distance, in points, between the top edge of the Button and the top edge of the worksheet.

TopLeftCell

获取一个 Range 对象,该对象表示位于 Button 左上角下面的单元格。Gets a Range object that represents the cell that lies under the upper-left corner of the Button.

Visible

获取或设置一个值,该值表示 Button 是否可见。Gets or sets a value that represents whether the Button is visible.

Width

获取或设置 Button 的宽度(以磅为单位)。Gets or sets the width of the Button in points.

ZOrder

获取 Button 的 Z 顺序位置。Gets the z-order position of the Button.

方法

Activate()

激活 ButtonActivates the Button.

BringToFront()

Button 置于 Z 顺序的顶层。Brings the Button to the front of the z-order.

CopyPicture(XlPictureAppearance, XlCopyPictureFormat)

Button 作为图片复制到剪贴板。Copies the Button to the Clipboard as a picture.

Delete()

从工作表中删除动态创建的 Button 并将其从 ControlCollection 中移除。Deletes a dynamically created Button from the worksheet and removes it from the ControlCollection.

Select(Object)

选择 ButtonSelects the Button.

SendToBack()

Button 置于 Z 顺序的底层。Sends the Button to the back of the z-order.

SetVisibleCore(Boolean)

Button 设置为指定的可见状态。Sets the Button to the specified visible state.

Update()

适用于