ControlExtensions Class

 

Provides extension methods you can use to add Windows Forms controls to Excel worksheets that have been customized by using the Office development tools in Visual Studio.

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

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

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

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAddButton(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddButton(ControlCollection^, Range^, String^)

Adds a new Button control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddCheckBox(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddCheckBox(ControlCollection^, Range^, String^)

Adds a new CheckBox control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddCheckedListBox(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddCheckedListBox(ControlCollection^, Range^, String^)

Adds a new CheckedListBox control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddComboBox(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddComboBox(ControlCollection^, Range^, String^)

Adds a new ComboBox control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddDataGridView(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddDataGridView(ControlCollection^, Range^, String^)

Adds a new DataGridView control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddDateTimePicker(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddDateTimePicker(ControlCollection^, Range^, String^)

Adds a new DateTimePicker control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddDomainUpDown(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddDomainUpDown(ControlCollection^, Range^, String^)

Adds a new DomainUpDown control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddHScrollBar(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddHScrollBar(ControlCollection^, Range^, String^)

Adds a new HScrollBar control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddLabel(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddLabel(ControlCollection^, Range^, String^)

Adds a new Label control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddLinkLabel(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddLinkLabel(ControlCollection^, Range^, String^)

Adds a new LinkLabel control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddListBox(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddListBox(ControlCollection^, Range^, String^)

Adds a new ListBox control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddListView(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddListView(ControlCollection^, Range^, String^)

Adds a new ListView control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddMaskedTextBox(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddMaskedTextBox(ControlCollection^, Range^, String^)

Adds a new MaskedTextBox control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddMonthCalendar(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddMonthCalendar(ControlCollection^, Range^, String^)

Adds a new MonthCalendar control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddNumericUpDown(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddNumericUpDown(ControlCollection^, Range^, String^)

Adds a new NumericUpDown control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddPictureBox(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddPictureBox(ControlCollection^, Range^, String^)

Adds a new PictureBox control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddProgressBar(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddProgressBar(ControlCollection^, Range^, String^)

Adds a new ProgressBar control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddPropertyGrid(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddPropertyGrid(ControlCollection^, Range^, String^)

Adds a new PropertyGrid control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddRadioButton(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddRadioButton(ControlCollection^, Range^, String^)

Adds a new RadioButton control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddRichTextBox(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddRichTextBox(ControlCollection^, Range^, String^)

Adds a new RichTextBox control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddTextBox(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddTextBox(ControlCollection^, Range^, String^)

Adds a new TextBox control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddTrackBar(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddTrackBar(ControlCollection^, Range^, String^)

Adds a new TrackBar control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddTreeView(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddTreeView(ControlCollection^, Range^, String^)

Adds a new TreeView control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddVScrollBar(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddVScrollBar(ControlCollection^, Range^, String^)

Adds a new VScrollBar control to the worksheet at the range specified.

System_CAPS_pubmethodSystem_CAPS_staticAddWebBrowser(ControlCollection^, Double, Double, Double, Double, String^)

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

System_CAPS_pubmethodSystem_CAPS_staticAddWebBrowser(ControlCollection^, Range^, String^)

Adds a new WebBrowser control to the worksheet at the range specified.

The ControlExtensions methods are extension methods that are available on the ControlCollection object returned by the Worksheet::Controls property (in an application-level project) or the WorksheetBase::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 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 Excel add-in projects that target the .NET Framework 4, you must add a reference to the Microsoft.Office.Tools.Excel.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 cell A1, and then adds text to the button. To use this example, run it from the Sheet1 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: