• AutoIT: ControlCommand是一个非常重要的指令


    ControlCommand可以确定窗口中的复选框是否选中状态,然后可以对这些复选框进行操作。
    可以对ComboBox和ListBox进行操作如选择下拉框的某个选项

    if WinExists("AutoIt 帮助") Then
        MsgBox(1,"OK", "Start")
        WinActivate("AutoIt帮助")
        if ControlCommand("AutoIt 帮助","","Button5","IsChecked", "") Then
            ControlCommand("AutoIt帮助","", "Button5","UnCheck", "")
            ControlCommand("AutoIt帮助","", "Button6","UnCheck", "")
            ControlCommand("AutoIt帮助","", "Button7","UnCheck", "")
        Else
            ControlCommand("AutoIt帮助","", "Button5","Check", "")
            ControlCommand("AutoIt帮助","", "Button6","Check", "")
            ControlCommand("AutoIt帮助","", "Button7","Check", "")
     EndIf
    EndIf
    ControlCommand(“窗口标题”, "", 控件类名或ID ,"SelectString", 选中选项文本)

    而针对Radio CheckBox等选择类型的控件

    ControlCommand(“窗口标题”, "",控件类名或ID,"check", ””) 

     而对于ListBox类型的选择框�则需要通过一系列组合来操作选项�如下面是获取所有选项数据的例子:

    WinActivate(“窗口标题”)
        $hWnd= ControlGetHandle(“窗口标题”, "", “控件ID”)
        $count= _GUICtrlListBox_GetCount($hWnd)
        For $i=0 To $count-1
            $hLabel= _GUICtrlListBox_GetText($hWnd, $i)
        Next
  • 相关阅读:
    大一秋学期记录
    韦尼克区受损者如何说话
    暑假训练idea汇总
    高三树洞
    OI回忆录
    NOI2018游记
    收藏
    PKUSC2018游记
    CTSC/APIO2018游记
    Caused by: org.xml.sax.SAXParseException: 外部 DTD: 无法读取外部 DTD 'mybatis-generator-config_1_0.dtd'
  • 原文地址:https://www.cnblogs.com/autotest/p/3262272.html
Copyright © 2020-2023  润新知