shiv Posted July 15, 2013 Share Posted July 15, 2013 can any one suggest that which fn should i used to know whether checkbox is in read only mode or not. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 15, 2013 Moderators Share Posted July 15, 2013 vis,Welcome to the AutoIt forum. I am assuming this is a checkbox in an external application - so I suggest trying ControlCommand with the IsEnabled command. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
shiv Posted July 15, 2013 Author Share Posted July 15, 2013 Thanks M23 for helping , but i have already used the below mentioned code: Local $iCheck = ControlCommand("Options","checkbox","IsEnabled",288) If $iCheck == 0 Then $sRemark = "PASS" Sleep(5000) ControlClick("Options","checkbox",288) ControlClick("Options","OK",1) else $sRemark = "ALREADYCHECKED" ControlClick("Options","OK",1) [in the else part i have used controlclick for OK button only i.e. if checkbox is already checked no need to check it, becuse if i do that it will uncheck the checkbox AND ,what i want from this code is that if my checkbox is already checked/Enabled then it should not click on the checkbox or is should show the prompt that your checkbox is already ckecked. please help Link to comment Share on other sites More sharing options...
JohnOne Posted July 15, 2013 Share Posted July 15, 2013 Thanks M23 for helping , but i have already used the below mentioned code: Local $iCheck = ControlCommand("Options","checkbox","IsEnabled",288) If $iCheck == 0 Then $sRemark = "PASS" Sleep(5000) ControlClick("Options","checkbox",288) ControlClick("Options","OK",1) else $sRemark = "ALREADYCHECKED" ControlClick("Options","OK",1) [in the else part i have used controlclick for OK button only i.e. if checkbox is already checked no need to check it, becuse if i do that it will uncheck the checkbox AND ,what i want from this code is that if my checkbox is already checked/Enabled then it should not click on the checkbox or is should show the prompt that your checkbox is already ckecked. please helpyou need to decide whether you want to test if it's enabled or checked AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
shiv Posted July 15, 2013 Author Share Posted July 15, 2013 i want to test whether it is checked or unchecked Link to comment Share on other sites More sharing options...
JohnOne Posted July 15, 2013 Share Posted July 15, 2013 Then you should use the "IsChecked" command and not the "IsEnabled". But before you do that you should take a good and proper look at it in the help file, because you seem to have wrong parameters. You'll need to use the window info toll in autoit install dir to get the control id of your target. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
shiv Posted July 16, 2013 Author Share Posted July 16, 2013 hi john i have already used "IsChecked" command but didn't get success, and in the code mentioned above i have used the window info tool, 288 mentioned above is the checkbox ID,, can you provide me the code for " if the checkbox is already checked then it prompt a message that your checkbox is checked already, so not need to check it. Link to comment Share on other sites More sharing options...
JohnOne Posted July 16, 2013 Share Posted July 16, 2013 Post the contents of the summary tab in window info tool. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
shiv Posted July 16, 2013 Author Share Posted July 16, 2013 >>>> Window <<<< Title: Options Class: #32770 Position: 8, 8 Size: 433, 507 Style: 0x94C800C4 ExStyle: 0x00010101 Handle: 0x002602BE >>>> Control <<<< Class: Button Instance: 13 ClassnameNN: Button13 Name: Advanced (Class): [CLASS:Button; INSTANCE:13] ID: 288 Text: Checkbox Position: 63, 149 Size: 330, 16 ControlClick Coords: 77, 4 Style: 0x50010003 ExStyle: 0x00000004 Handle: 0x001D08A0 Link to comment Share on other sites More sharing options...
JohnOne Posted July 16, 2013 Share Posted July 16, 2013 Local $iCheck = ControlCommand("Options", "", "[CLASS:Button; INSTANCE:13]", "IsChecked") If $iCheck Then $sRemark = "Is checked" Else $sRemark = "Is not checked" EndIf MsgBox(0,"state", $sRemark) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
shiv Posted July 17, 2013 Author Share Posted July 17, 2013 Thanks(1000) john. its working Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now