共用方式為


Microsoft.Office.Tools.Excel.Controls Namespace

The Microsoft.Office.Tools.Excel.Controls namespace contains a set of Windows Forms controls that can be used on a Worksheet host item in an Office solution. Each of these classes extends a base class that is in the System.Windows.Forms namespace with additional functionality specific to a Microsoft Office Excel worksheet. For example, the Button class extends the functionality of the Button class.

Classes

Button

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

CheckBox

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

CheckedListBox

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

ComboBox

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

DataGridView

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

DateTimePicker

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

DomainUpDown

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

HScrollBar

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

Label

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

LinkLabel

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

ListBox

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

ListView

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

MaskedTextBox

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

MonthCalendar

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

NumericUpDown

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

PictureBox

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

ProgressBar

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

PropertyGrid

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

RadioButton

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

RichTextBox

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

TextBox

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

TrackBar

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

TreeView

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

VScrollBar

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

WebBrowser

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

Remarks

You can add and remove the controls in this namespace at run time by using the appropriate method. For example, use the AddButton method to add a Microsoft.Office.Tools.Excel.Controls.Button to a worksheet at run time. For more information, see Adding Controls to Office Documents at Run Time.

In a document-level project for Excel, you can also add the controls in this namespace to your Excel worksheet at design time by dragging a control from the Toolbox directly to your document. For more information, see How to: Add Windows Forms Controls to Office Documents.

There are some differences between Windows Forms controls that are added to Excel worksheets and Windows Forms controls that are added to Windows Forms. For more information, see Limitations of Windows Forms Controls on Office Documents.