Jump to content
Sign in to follow this  
palbertario

Reuse variable on Treeview Item

Recommended Posts

palbertario
Hello,
 
I am trying to check an item on a treeview after obtaining the position of the item. Unfortunately the autofind doesn't see the text inside the treeview so I cannot just search for the text of the item I want checked. I am new at autoit, but I am not sure why the item is not getting checked int he code below. I obtain the position and even use the hashtag. I think there may be something wrong with the way I use && and "". Could someone take a look at the code I put below to determine why?
 
Thank you!
-----
-----Code
------
#include <Array.au3>
 
Local $array[4] = ["apple", "orange", "banana", "tomato"]
Local $sSearch = InputBox("test", "Select the  product you wish to use.")
;If @error Then Exit
Local $iIndex = _ArraySearch($array, $sSearch, 0, 0, 0, 1)
If @error Then
    MsgBox(0, "Not Found", '"' & $sSearch & '" was not found in the array.')
Else
    MsgBox(0, "Found", '"' & $sSearch & '" was found in the array at position ' & $iIndex & ".")
 EndIf

ControlTreeView("test", "", "[CLASS:SysTreeView32; INSTANCE:1]", "Check", "#"&$iIndex&)

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.