Skip to content
本页内容

FormControlType (属性)

返回 ET 控件 (ET 控件:ET 本身具有的控件,而不是 ActiveX 控件。) XlFormControl 类型,只读。

说明

不能对 ActiveX 控件使用该属性( Shape 对象的 Type 属性必须返回 msoFormControl)。

示例

python
#本示例清除第一张工作表中的所有ET复选框
def test():
    shapes = Application.Worksheets.Item(1).Shapes
    for i in range(1, shapes.Count):
        if shapes.Item(i).Type == msoFormControl:
            if shapes.Item(i).FormControlType == xlCheckBox:
                shapes.Item(i).ControlFormat.Value = False
python
#本示例判断活动工作表中第二个形状是否为ET复选框
def test():
    shapes = Application.Worksheets.Item(1).Shapes
    if shapes.Item(2).FormControlType == xlCheckBox:
        print("第二个形状是复选框")
    else:
        print("第二个形状不是复选框")