如何取消选中复选框?
我真的想要这个复选框'未选中'。之前我正在使用send_keys,我可以发送一个切换(空格)"选中/取消选中",但是当我发送切换按钮时它实际上可以被取消选中,然后它会被检查,我不会&#39不想要。我希望它绝对是经过联合国检查的。
我该怎么做?
到目前为止,这是我的AutoIt脚本:
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
Local $Title = "Campus Portal Install"
Run("C:\Temp\PortalInstall-13_1_A_HF5_0003\cmcportalinstall.exe")
WinWaitActive($Title)
Send("z:\CampusPortal\")
ControlCommand($Title, "", "cbBackupIIS", "UnCheck")
ControlCommand($Title, "", "[NAME:cbBackupIIS]", "UnCheck")
ControlCommand($Title, "", 1049322, "UnCheck")
ControlCommand($Title, "", "[CLASS:#1049322]", "UnCheck")
ControlCommand($Title, "", "CLASS:Button]", "UnCheck")
ControlCommand($Title, "", "[WindowsForms10.BUTTON.app.0.2004eee]", "UnCheck")
ControlCommand("Campus Portal Install", "", "cbBackupIIS", "UnCheck")
ControlCommand("Campus Portal Install", "", "[NAME:cbBackupIIS]", "UnCheck")
ControlCommand("Campus Portal Install", "", 1049322, "UnCheck")
ControlCommand("Campus Portal Install", "", "[CLASS:#1049322]", "UnCheck")
ControlCommand("Campus Portal Install", "", "CLASS:Button]", "UnCheck")
ControlCommand("Campus Portal Install", "", "[WindowsForms10.BUTTON.app.0.2004eee]", "UnCheck")
MsgBox($MB_SYSTEMMODAL, "Title", "This message box will timeout after 10 seconds or select the OK button.", 10)
我已经尝试过的每一个变种都留下了;他们没有错误,所以没有伤害他们;加上它显示了我尝试过的东西。
ControlSend工作正常。
以下是控制信息:
>>>> Window <<<<
Title: Campus Portal Install
Class: WindowsForms10.Window.8.app.0.2004eee
Position: 496, 166
Size: 608, 523
Style: 0x16CF0000
ExStyle: 0x00050100
Handle: 0x00450334
>>>> Control <<<<
Class: WindowsForms10.BUTTON.app.0.2004eee
Instance: 15
ClassnameNN: WindowsForms10.BUTTON.app.0.2004eee15
Name: cbBackupIIS
Advanced (Class): [NAME:cbBackupIIS]
ID: 1049322
Text: Backup IIS Entries?
Position: 108, 142
Size: 123, 15
ControlClick Coords: 55, 6
Style: 0x5601000B
ExStyle: 0x00000000
Handle: 0x001002EA
>>>> Mouse <<<<
Position: 663, 337
Cursor ID: 0
Color: 0xD6D3CE
>>>> StatusBar <<<<
>>>> ToolsBar <<<<
>>>> Visible Text <<<<
Version 13.1.a.hf5.0003\campusportal
Backup IIS Entries?
Backup Files?
...
C:\CampusPortalBackup\
Backup Path:
...
z:\CampusPortal\
Base Path:
E&xit
&Next >
Choose a base location and which applications will be installed.
Application Settings
>>>> Hidden Text <<<<
App Pool Credentials
Password:
Username:
Use Integrated Authentication?
Configure Portal Database?
Run Portal SQL Update Scripts?
Portal
Password:
Username:
Database Name:
Server Name:
Campus
Password:
Username:
Database Name:
Server Name:
Host Header:
Register ASP.Net with IIS?
IP Address:
global
DSBXDANSQL01
Description:
Branding Folder:
URL Name:
You are now ready to install/remove the selected applications. Click the Begin button below to start the installation/removal/configuration process.
Clear All
Select All
Campus List:
Student:
Applicant:
Activate?
Employer:
Staff:
...
http://localhost:80/
Portal:
http://localhost:99/
Configuration Tool:
http://localhost:98/
Admin Console:
127.0.0.1
SMTP Server:
seconds.
30
Query Interval:
50
Records Quantity:
Password:
NT Domain\User:
minute(s)
Staff Active Directory Settings:
dev
NT Domain:
dev.campusmgmt.com
Fully Qual. Domain:
LDAP://OU=CampusUsers,DC=dev,DC=campusmgmt,DC=com
AD Path:
Student Active Directory Settings:
dev
NT Domain:
dev.campusmgmt.com
Fully Qual. Domain:
LDAP://OU=CampusUsers,DC=dev,DC=campusmgmt,DC=com
AD Path:
1
Cache Refresh:
doc|rtf|pdf|xls|txt
0
Allowable File Types:
Cache Refresh Time:
Add
Allow IPs
...
http://localhost:91/
http://localhost:97/
Security Service:
Login Service:
...
http://localhost:95/
http://localhost:93/
http://localhost:92/
http://localhost:96/
Online Registration:
Payment Service:
Messaging Service:
http://localhost:94/
Reporting Service:
Portal Data Service:
\\DSBXDANSQL01\Reports
Default Report Path:
\\DSBXDANSQL01\Reports
Custom Report Path:
答案 0 :(得分:0)
在示例here中,您应该能够使用_IsChecked($hWnd)
来确定是否选中了复选框。按钮是复选框的正确类类型。
答案 1 :(得分:0)
我也总是归零。
我设法使用
让它工作 If ControlCommand("Login", "Login", $checkBox, "IsChecked") Then
ControlCommand("Login", "Login", $checkBox, "Uncheck")
EndIf