Jump to content

Clicking on an Item in Listbox - Help Please - (Moved)


Bill413
 Share

Recommended Posts

Hi, very new to AutoIT first of all..., have been using "AutoIT Window Info" to script the pressing buttons by finding object, moving the curser around, using Combobox, all okay so far.

However, I am struggling with the task of selecting an item in a ListBox, and clicking on it.

; Select Collection Point Button - THIS WORKS, but is not a ListBox
   $sWinTitle = "Unit Concern Pareto Reports"
   $sWinText = "Collection Point"
   WinActivate($sWinTitle,$sWinText)
   $handle = WinGetHandle($sWinTitle,$sWinText)
   ControlSend($handle,"","[CLASS:WindowsForms10.Window.8.app." & $sClass & "]","{DOWN 0}{ENTER}")
   sleep(1000)

; Select PD CAL GATE BUY OFF - NOT WORKING
   $sWinTitle = "Unit Concern Pareto Reports"
   $sWinText = "Collection Point"
   WinActivate($sWinTitle,$sWinText)
   $handle = WinGetHandle($sWinTitle,$sWinText)

ControlSend($handle,"","[CLASS:WindowsForms10.LISTBOX.app." & $sClass & "]","{DOWN 2}{ENTER}")

Tried a couple of other approaches from the forums (see below)… yet no success... hoping someone can offer an some hints, thank you ahead of time!

;$hWindow = WinGetHandle("Unit Concern Pareto Reports")
;$hControl = ControlGetHandle($hWindow, "", "[CLASS:WindowsForms10.Window.8.app.0.1ca0192_r9_ad1; INSTANCE:32]")
;ControlCommand($hWindow, "", $hControl, "SelectString", "PD CAL GATE BUY OFF") ; Change this

;#include <GuiListBox.au3>
;Dim $ttlWindow
;Dim $hdlWindow
;Dim $cidList
;Dim $hdlList
;$ttlWindow = "_lstDataCollectionAreas_0"
;$cidList = "[CLASS:WindowsForms10.LISTBOX.app.0.1ca0192_r9_ad1]"
;$hdlWindow = WinGetHandle($ttlWindow)
;$hdlList = ControlGetHandle($hdlWindow, "", $cidList)
;_GUICtrlListBox_ClickItem($hdlList, 1, "down")

AutoIT.JPG

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...