Bestimmtes Item von GuiCtrlCreateList() anklicken

  • Hallo,

    ich moechte ein bestimmtes Item aus einer mit GuiCtrlCreateList() erstellten Liste auswaehlen.
    _GUICtrlListBox_SelectString() habe ich schon ausprobiert, funktioniert aber nicht!

    Hat jemand eine Idee?

    PS: Ich moechte unter keinen Umstaenden die Liste mit einer anderen Methode als GuiCtrlCreateList() erstellen.

    Einmal editiert, zuletzt von pete_gzome (23. Mai 2011 um 22:00)

  • Beweis des Gegenteils:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #Include <GuiListBox.au3>
    #region - GUI Create
    $hGUI=GUICreate('', 200,200)
    $List = guictrlcreatelist("",4,4, BitOR($LBS_STANDARD, $LBS_EXTENDEDSEL))
    GUICtrlSetData(-1, "bla")
    GUICtrlSetData(-1, "blub")
    GUICtrlSetData(-1, "foo")
    GUICtrlSetData(-1, "bar")
    GUISetState()
    #endregion

    [/autoit] [autoit][/autoit] [autoit]

    sleep(3000)
    _GUICtrlListBox_SelectString($List, "blub")
    #region - GUI SelectLoop
    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    Exit
    EndSelect
    WEnd
    #endregion

    [/autoit]
    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #Include <GuiListBox.au3>
    #region - GUI Create
    $hGUI=GUICreate('', 200,200)
    $List = guictrlcreatelist("",4,4, BitOR($LBS_STANDARD, $LBS_EXTENDEDSEL))
    _GUICtrlListBox_AddString($List, "bla")
    _GUICtrlListBox_AddString($List, "blub")
    _GUICtrlListBox_AddString($List, "foo")
    _GUICtrlListBox_AddString($List, "bar")
    GUISetState()
    #endregion

    [/autoit] [autoit][/autoit] [autoit]

    sleep(3000)
    _GUICtrlListBox_SelectString($List, "blub")
    #region - GUI SelectLoop
    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    Exit
    EndSelect
    WEnd
    #endregion

    [/autoit]
  • Wow, ich habe aus Versehen nicht die Variable mit der Liste, sondern die mit dem Array der Listen Items angegeben.

    shame on me

    ... und danke Dir :s