Skip to content
本页内容

Value (属性)

返回或设置一个 int 值,它代表指定的控件格式的值。

示例

python
#本示例将第一张工作表的第一个形状(组合框)的 Value 属性设置为1
def test():
    shape = Worksheets.Item(1).Shapes.Item(1)
    shape.ControlFormat.Value = 1
python
#本示例显示活动工作表的第二个形状(列表框)选定的数据项的编号
def test():
    shape = ActiveSheet.Shapes.Item(2)
    print(shape.ControlFormat.Value)