編輯

共用方式為


Shapes.AddFormControl(XlFormControl, Int32, Int32, Int32, Int32) Method

Definition

Creates a Microsoft Excel control. Returns a Shape object that represents the new control.

public:
 Microsoft::Office::Interop::Excel::Shape ^ AddFormControl(Microsoft::Office::Interop::Excel::XlFormControl Type, int Left, int Top, int Width, int Height);
public Microsoft.Office.Interop.Excel.Shape AddFormControl (Microsoft.Office.Interop.Excel.XlFormControl Type, int Left, int Top, int Width, int Height);
Public Function AddFormControl (Type As XlFormControl, Left As Integer, Top As Integer, Width As Integer, Height As Integer) As Shape

Parameters

Type
XlFormControl

Required XlFormControl. The Microsoft Excel control type. You cannot create an edit box on a worksheet. Can be one of these XlFormControl constants:xlButtonControlxlCheckBoxxlDropDownxlEditBoxxlGroupBoxxlLabelxlListBoxxlOptionButtonxlScrollBarxlSpinner

Left
Int32

Required Integer. The initial coordinates of the new object (in points) relative to the upper-left corner of cell A1 on a worksheet or to the upper-left corner of a chart.

Top
Int32

Required Integer. The initial coordinates of the new object (in points) relative to the upper-left corner of cell A1 on a worksheet or to the upper-left corner of a chart.

Width
Int32

Required Integer. The initial size of the new object, in points.

Height
Int32

Required Integer. The initial size of the new object, in points.

Returns

Remarks

Use the AddOLEObject(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) method or the Add(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) method of the OLEObjects collection to create an ActiveX control.

Applies to