ControlExtensions Class

 

Provides extension methods you can use to add Windows Forms controls to a Word document that has been customized by using the Office development tools in Visual Studio.

Namespace:   Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

System::Object
  Microsoft.Office.Tools.Word::ControlExtensions

[ExtensionAttribute]
[DebuggerNonUserCodeAttribute]
public ref class ControlExtensions abstract sealed 

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAddButton(ControlCollection^, Range^, Single, Single, String^)

Adds a new Button control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddButton(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new Button control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddCheckBox(ControlCollection^, Range^, Single, Single, String^)

Adds a new CheckBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddCheckBox(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new CheckBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddCheckedListBox(ControlCollection^, Range^, Single, Single, String^)

Adds a new CheckedListBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddCheckedListBox(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new CheckedListBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddComboBox(ControlCollection^, Range^, Single, Single, String^)

Adds a new ComboBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddComboBox(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new ComboBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddDataGridView(ControlCollection^, Range^, Single, Single, String^)

Adds a new DataGridView control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddDataGridView(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new DataGridView control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddDateTimePicker(ControlCollection^, Range^, Single, Single, String^)

Adds a new DateTimePicker control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddDateTimePicker(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new DateTimePicker control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddDomainUpDown(ControlCollection^, Range^, Single, Single, String^)

Adds a new DomainUpDown control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddDomainUpDown(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new DomainUpDown control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddHScrollBar(ControlCollection^, Range^, Single, Single, String^)

Adds a new HScrollBar control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddHScrollBar(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new HScrollBar control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddLabel(ControlCollection^, Range^, Single, Single, String^)

Adds a new Label control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddLabel(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new Label control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddLinkLabel(ControlCollection^, Range^, Single, Single, String^)

Adds a new LinkLabel control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddLinkLabel(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new LinkLabel control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddListBox(ControlCollection^, Range^, Single, Single, String^)

Adds a new ListBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddListBox(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new ListBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddListView(ControlCollection^, Range^, Single, Single, String^)

Adds a new ListView control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddListView(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new ListView control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddMaskedTextBox(ControlCollection^, Range^, Single, Single, String^)

Adds a new MaskedTextBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddMaskedTextBox(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new MaskedTextBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddMonthCalendar(ControlCollection^, Range^, Single, Single, String^)

Adds a new MonthCalendar control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddMonthCalendar(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new MonthCalendar control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddNumericUpDown(ControlCollection^, Range^, Single, Single, String^)

Adds a new NumericUpDown control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddNumericUpDown(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new NumericUpDown control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddPictureBox(ControlCollection^, Range^, Single, Single, String^)

Adds a new PictureBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddPictureBox(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new PictureBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddProgressBar(ControlCollection^, Range^, Single, Single, String^)

Adds a new ProgressBar control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddProgressBar(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new ProgressBar control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddPropertyGrid(ControlCollection^, Range^, Single, Single, String^)

Adds a new PropertyGrid control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddPropertyGrid(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new PropertyGrid control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddRadioButton(ControlCollection^, Range^, Single, Single, String^)

Adds a new RadioButton control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddRadioButton(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new RadioButton control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddRichTextBox(ControlCollection^, Range^, Single, Single, String^)

Adds a new RichTextBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddRichTextBox(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new RichTextBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddTextBox(ControlCollection^, Range^, Single, Single, String^)

Adds a new TextBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddTextBox(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new TextBox control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddTrackBar(ControlCollection^, Range^, Single, Single, String^)

Adds a new TrackBar control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddTrackBar(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new TrackBar control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddTreeView(ControlCollection^, Range^, Single, Single, String^)

Adds a new TreeView control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddTreeView(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new TreeView control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddVScrollBar(ControlCollection^, Range^, Single, Single, String^)

Adds a new VScrollBar control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddVScrollBar(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new VScrollBar control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddWebBrowser(ControlCollection^, Range^, Single, Single, String^)

Adds a new WebBrowser control to the document in the specified size and location.

System_CAPS_pubmethodSystem_CAPS_staticAddWebBrowser(ControlCollection^, Single, Single, Single, Single, String^)

Adds a new WebBrowser control to the document in the specified size and location.

The ControlExtensions methods are extension methods that are available on the ControlCollection object returned by the Document::Controls property (in an application-level project) or the DocumentBase::Controls property (in a document-level project) at run time. To add a specific control to a document, use the method that includes the name of the control in the method name. For example, to add a Button, use the AddButton method.

For more information about adding controls to a document, see Adding Controls to Office Documents at Run Time. For more information about extension methods, see Extension Methods (C# Programming Guide) and Extension Methods (Visual Basic).

System_CAPS_noteNote

In Word add-in projects that target the .NET Framework 4, you must add a reference to the Microsoft.Office.Tools.Word.v4.0.Utilities.dll assembly before you can access the ControlExtensions methods.

The following code example uses the AddButton method to add a Button control to the first paragraph in the document, and then adds text to the button. To use this example, run it from the ThisDocument class in a document-level project.

No code example is currently available or this language may not be supported.

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: