AutoVR Posted January 12, 2011 Share Posted January 12, 2011 Hi, I am trying to select items in a checkbox list like the one displayed here: Using ControlCommand SelectString does not work, but I got around this by: 1) Firstly using ControlCommand FindString to find the index of the item 2) Then using ControlClick and clicking on the checkbox, by calculating the x,y coords of the checkbox using the index of the item (limitation: Can't scroll down the list) However, there is a problem... when using ControlCommand FindString to find the index of the item, it starts from 0 for the first item - but 0 is also returned if the item can't be found! Which means I'm unable to tell if the item actually exists as I want to display an error to the user if the item they're wanting to select doesn't exist. Does anyone know of a way around this? Thanks Link to comment Share on other sites More sharing options...
Varian Posted January 13, 2011 Share Posted January 13, 2011 Will any of the _GUICtrlListBox functions work with this control? Link to comment Share on other sites More sharing options...
AutoVR Posted January 13, 2011 Author Share Posted January 13, 2011 Will any of the _GUICtrlListBox functions work with this control?Yes, _GUICtrlListBox_FindString worked!! It returns -1 if it can't find the item, and 0 for the first item. Perfect, thank you Varian! Link to comment Share on other sites More sharing options...
Varian Posted January 13, 2011 Share Posted January 13, 2011 Glad to help! Link to comment Share on other sites More sharing options...
gigabyte Posted June 16, 2011 Share Posted June 16, 2011 Yes, _GUICtrlListBox_FindString worked!! It returns -1 if it can't find the item, and 0 for the first item. Perfect, thank you Varian! Can you please provide a piece of code for finding a particular element from a dropdown and then clicking it..Couldnt make my code work by using _GUICtrlListBox_FindString. 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