Microsoft.Office.Tools.Excel.Controls 命名空间包含一组 Windows 窗体控件,它们可用于 Office 解决方案中的 Worksheet 宿主项。这些类中的每一个类都扩展 System.Windows.Forms 命名空间中的一个基类,该基类具有针对某个 Microsoft Office Excel 工作表的附加功能。例如,Microsoft.Office.Tools.Excel.Controls.Button 类扩展 System.Windows.Forms.Button 类的功能。
通过使用适当的方法,您可以在运行时添加和移除该命名空间中的控件。例如,在运行时使用 AddButton 方法向工作表中添加一个 Microsoft.Office.Tools.Excel.Controls.Button。有关更多信息,请参见在运行时向 Office 文档添加控件。
在文档级 Excel 项目中,您也可以在设计时将该命名空间中的控件添加到您的 Excel 工作表,方法是:从**“工具箱”**中将一个控件直接拖动到您的文档。有关更多信息,请参见 如何:为 Office 文档添加 Windows 窗体控件。
添加到 Excel 工作表的 Windows 窗体控件与添加到 Windows 窗体的 Windows 窗体控件之间有一些区别。有关更多信息,请参见 Office 文档上的 Windows 窗体控件的限制。
类
类 | 说明 | |
---|---|---|
![]() |
Button | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体按钮。 |
![]() |
CheckBox | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体复选框。 |
![]() |
CheckedListBox | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 CheckedListBox。 |
![]() |
ComboBox | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 ComboBox。 |
![]() |
DataGridView | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 DataGridView。 |
![]() |
DateTimePicker | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 DateTimePicker。 |
![]() |
DomainUpDown | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 DomainUpDown。 |
![]() |
HScrollBar | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 HScrollBar。 |
![]() |
Label | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 Label。 |
![]() |
LinkLabel | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 LinkLabel。 |
![]() |
ListBox | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 ListBox。 |
![]() |
ListView | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 ListView。 |
![]() |
MaskedTextBox | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 MaskedTextBox。 |
![]() |
MonthCalendar | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 MonthCalendar。 |
![]() |
NumericUpDown | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 NumericUpDown。 |
![]() |
PictureBox | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 PictureBox。 |
![]() |
ProgressBar | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 ProgressBar。 |
![]() |
PropertyGrid | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 PropertyGrid。 |
![]() |
RadioButton | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 RadioButton。 |
![]() |
RichTextBox | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 RichTextBox。 |
![]() |
TextBox | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 TextBox。 |
![]() |
TrackBar | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 TrackBar。 |
![]() |
TreeView | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 TreeView。 |
![]() |
VScrollBar | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 VScrollBar。 |
![]() |
WebBrowser | 表示可添加到 Microsoft Office Excel 工作表的 Windows 窗体 WebBrowser。 |