_GUICtrlListBox_GetSelItemsText problem

  • hab gerade selber geschaft ^^

    man muss aus $hListBox = _GUICtrlListBox_Create($hGUI, "", 198, 2, 200, 298)

    das machen $hListBox = _GUICtrlListBox_Create($hGUI, "", 198, 2, 200, 298,BitOR($LBS_STANDARD, $LBS_EXTENDEDSEL))

    Spoiler anzeigen

    Heeey,

    ich hab da ma wieder nen kleines problem
    und zwar so von dem markierten "list box ding" einfach ausgeben werden
    aber er sagt mir immer das nicht markiert ist.
    und dann bricht er natürlich mit nem fehler ab.
    achso und die hilfe hat mir auch nichts gebracht.

    Gruß Nitrama

    Spoiler anzeigen
    [autoit]

    #include <GUIListBox.au3>
    #include <GuiConstantsEx.au3>

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

    $hGUI = GUICreate("(UDF) ListBox: Erzeugen", 400, 300)
    $button = GUICtrlCreateButton ("test",2,2,100,50)
    $button2 = GUICtrlCreateButton ("löchen",2,55,100,50)
    $button3 = GUICtrlCreateButton ("name",2,130,100,50)
    $hListBox = _GUICtrlListBox_Create($hGUI, "", 198, 2, 200, 298)
    GUISetState()

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

    while 1
    Local $sItems, $aItems, $hListBox
    $NMSG = GUIGetMsg()
    Switch $NMSG
    Case $GUI_EVENT_CLOSE
    exit
    case $button
    _GUICtrlListBox_AddString($hListBox, StringFormat("%X : Zufallstring", Random(1, 999, 1)))
    case $button2
    $list = _GUICtrlListBox_GetCount($hListBox)
    $i = -1
    ; msgbox (0,"",$list)
    While 1
    $i += 1
    ; msgbox (0,"",$i&">"&$list)
    if $i < $list Then
    ; msgbox (0,"",_GUICtrlListBox_GetSel($hListBox, $i))
    if _GUICtrlListBox_GetSel($hListBox, $i) = True Then
    _GUICtrlListBox_DeleteString ($hListBox, $i)
    EndIf
    ElseIf $i == $list then
    exitloop
    EndIf
    WEnd


    case $button3

    $aItems = _GUICtrlListBox_GetSelItemsText($hListBox)
    $aItems = $aItems[1]
    MsgBox (0,0,$aItems)
    EndSwitch

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

    WEnd

    [/autoit]

    2 Mal editiert, zuletzt von Nitrama (12. Juli 2011 um 17:48)