zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    Django -- 路由系统(URLconf)
    Django简介
    jQuery
    DOM
    JavaScript
    HTML,CSS
    Redis PK Memcached
    ORM框架-SQLAlchemy
    Memcached操作以及用法
    Py3快速下载地址
  • 原文地址:https://www.cnblogs.com/autotest/p/3262272.html
Copyright © 2011-2022 走看看