Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select List Box Item
#1
I am able to get the count of items in a list box using GetListViewItemText. I am able to the text of any items in the list box. The problem is, I am having a difficult time selecting the item :lol:

For example, the list box contains 20 items. I am able to get the name of the 16th item, but not able to select it. I have tried LB_SelectString to select the actual string and I have also tried LB_SelectItem using the index number, but it's not working.

Help please.
#2
There are two different types of list controls. Controls that have ListBox classname (simple listboxes) and controls that have SysListView32 classname (like in Windows Explorer). LB_x functions work only with ListBox controls. GetListViewItemText works only with SysListView32.

Use accessible object functions instead. There are dialogs in the floating toolbar.
#3
Ahhhh ok, yes it is SysListView32. Thank you so much!
#4
If the item is from items 1-10, acc finds it. But any item after that, which are not showing on the screen, I am getting an object not found.
#5
In the "Find accessible object" dialog, click Options and check Invisible.
#6
Im getting Error (RT) in Macro: the point is outside the window


Sad
#7
Ok nevermind, I got it working :wink:


Thank youuuuuuu!
#8
Cry Now it is selecting the item in the lisbox, problem is, I can't use 'Y to press the enter key or do mouse action because it does not show on the screen Tongue

What to do next so I can click on the item?
#9
To click, use a.DoDefaultAction.

a.Select(3); key Y

also works for me. To use mouse, need to scroll into view. It is possible but not easy.
#10
Mouse or Keyboard does not work unless the object is showing on the screen. I also tried DoDefaultAction, didn't work as well. So the work around I was able to think of was to use:

Code:
Copy      Help
rep xIndex
    'D
'Y



It takes forever sometimes because the list box can contain up to 500 items. So you can just imagine if I would like to jump to item 300 Tongue

Ohhhh I have a headache
#11
Try MouseWheel.

Code:
Copy      Help
act child("" "SysListView32")
key CH
MouseWheel -a.elem/3+1

Here 3 is the number of lines scrolled by single wheel tick. It may be different on your computer. 3 is default setting.
#12
Wow, so much faster than my rep 'D :lol:

Good morningggggggg!

Thank you so much.
#13
Maybe this is too much, but would you kindly please explain what MouseWheel -a.elem/3+1 means? I pressed F1 on MouseWheel and there was not any explantion :lol:

When it hits the last item on the list, it just keeps on scrolling. Maybe I can make modifications if I knew what it mean.


Thank you.


Forum Jump:


Users browsing this thread: 1 Guest(s)