tags:

views:

364

answers:

1

I am using Autoit to create an auto-install app. There is an dialog which contains a ListBox control, and in the listbox there are some choices for user (the detailed choices depends on user's machine, for some users there maybe only one choice, for some users there may be 3 choices etc), so I want to get the texts in the listbox to make the decision. I have tried the following code but it did not work

; 2223 is the ID of listbox

$txt = ControlGetText("Select Web Site", "", "[ID:2223]") 
Msgbox(0, "", $txt)

after execution the $txt is null

So what should I do to get the texts in Listbox?

Here is the attribute of the listbox monitored by AutoIt v3 Window Info: Class: WindowsForms10.Listbox.app.0.33c0d9d

A: 

What I want to do is to select one of the item named "Default Web Site" in the list, but it seems that the list content can not be got, so finally i tried anthor way:

At first I make the listbox focused, then I choose the item "Default Web Site" by sending "Def"

    ControlFocus($Title, "", "[NAME:lbWebSites]")
    ; select the option "Default Web Site", so press "def" to set the desired item
    Send("Def")
Carlos_Liu

related questions