Jump to content

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


AutoVR
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • 5 months later...

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...