共用方式為


Microsoft.Office.Tools.Word.Controls Namespace

The Microsoft.Office.Tools.Word.Controls namespace contains a set of Windows Forms controls that can be used on a Document 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 Word document. For example, the Microsoft.Office.Tools.Word.Controls.Button class extends the functionality of the System.Windows.Forms.Button class.

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.Word.Controls.Button to a document at run time. For more information, see Adding Controls to Office Documents at Run Time.

In a document-level project for Word, you can also add the controls in this namespace to your Word document 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 Word documents and Windows Forms controls that are added to Windows Forms. For more information, see Limitations of Windows Forms Controls on Office Documents.

Classes

  Class Description
Public class Button Represents a Windows Forms button that can be added to a Microsoft Office Word document.
Public class CheckBox Represents a Windows Forms check box that can be added to a Microsoft Office Word document.
Public class CheckedListBox Represents a Windows Forms checked list box that can be added to a Microsoft Office Word document.
Public class ComboBox Represents a Windows Forms combo box that can be added to a Microsoft Office Word document.
Public class DataGridView Represents a Windows Forms DataGridView that can be added to a Microsoft Office Word document.
Public class DateTimePicker Represents a Windows Forms DateTimePicker control that can be added to a Microsoft Office Word document.
Public class DomainUpDown Represents a Windows Forms DomainUpDown that can be added to a Microsoft Office Word document.
Public class HScrollBar Represents a Windows Forms HScrollBar that can be added to a Microsoft Office Word document.
Public class Label Represents a Windows Forms Label that can be added to a Microsoft Office Word document.
Public class LinkLabel Represents a Windows Forms LinkLabel that can be added to a Microsoft Office Word document.
Public class ListBox Represents a Windows Forms ListBox that can be added to a Microsoft Office Word document.
Public class ListView Represents a Windows Forms ListView that can be added to a Microsoft Office Word document.
Public class MaskedTextBox Represents a Windows Forms MaskedTextBox that can be added to a Microsoft Office Word document.
Public class MonthCalendar Represents a Windows Forms MonthCalendar that can be added to a Microsoft Office Word document.
Public class NumericUpDown Represents a Windows Forms NumericUpDown that can be added to a Microsoft Office Word document.
Public class PictureBox Represents a Windows Forms PictureBox that can be added to a Microsoft Office Word document.
Public class ProgressBar Represents a Windows Forms ProgressBar that can be added to a Microsoft Office Word document.
Public class PropertyGrid Represents a Windows Forms PropertyGrid that can be added to a Microsoft Office Word document.
Public class RadioButton Represents a Windows Forms RadioButton that can be added to a Microsoft Office Word document.
Public class RichTextBox Represents a Windows Forms RichTextBox that can be added to a Microsoft Office Word document.
Public class TextBox Represents a Windows Forms TextBox that can be added to a Microsoft Office Word document.
Public class TrackBar Represents a Windows Forms TrackBar that can be added to a Microsoft Office Word document.
Public class TreeView Represents a Windows Forms TreeView that can be added to a Microsoft Office Word document.
Public class VScrollBar Represents a Windows Forms VScrollBar that can be added to a Microsoft Office Word document.
Public class WebBrowser Represents a Windows Forms WebBrowser that can be added to a Microsoft Office Word document.

See Also

Reference

Other Resources

Windows Forms Controls on Office Documents Overview

Limitations of Windows Forms Controls on Office Documents

Adding Controls to Office Documents at Run Time

How to: Add Windows Forms Controls to Office Documents