Skip to content
本页内容

ControlFormat (属性)

返回一个 ControlFormat 对象,该对象包含 ET 控件 (ET 控件:ET 本身具有的控件,而不是 ActiveX 控件。)属性。只读。

示例

python
#本示例删除第一张工作表中列表框中选定的数据项。如果 Shapes(2) 代表的不是列表框,则本示例将无效
def test():
    controlFormat = Worksheets.Item(1).Shapes.Item(2).ControlFormat
    controlFormat.RemoveItem(controlFormat.ListIndex)
python
#本示例判断如果活动工作表中第三个形状是复选框,则不勾选复选框
def test():
    shapes = ActiveSheet.Shapes
    if shapes.Item(3).Type == msoFormControl and shapes.Item(3).FormControlType == xlCheckBox:
        shapes.Item(3).ControlFormat.Value = False