Jump to content
Sign in to follow this  
AutoVR

ControlCommand FindString returns 0 for first item, and 0 for item not found?

Recommended Posts

AutoVR

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 :x

Share this post


Link to post
Share on other sites
Varian

Will any of the _GUICtrlListBox functions work with this control?

Share this post


Link to post
Share on other sites
AutoVR

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! :x

Share this post


Link to post
Share on other sites
gigabyte

Yes, _GUICtrlListBox_FindString worked!! It returns -1 if it can't find the item, and 0 for the first item. Perfect, thank you Varian! :huh2:

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.