Listbox und rechte Maustaste

    • Offizieller Beitrag

    Klar geht das! :D

    So:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>

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

    Example()

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

    Func Example()
    Local $MESSAGE = "The following buttons have been clicked"
    Local $add, $clear, $mylist, $close, $msg

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

    GUICreate("My GUI list") ; will create a dialog box that when displayed is centered

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

    $add = GUICtrlCreateButton("Add", 32, 32, 75, 25)
    $clear = GUICtrlCreateButton("Clear", 32, 72, 75, 25)
    $mylist = GUICtrlCreateList("buttons that have been clicked", 140, 32, 240, 97)
    GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling
    GUICtrlSetData(-1, $MESSAGE)
    $Context = GUICtrlCreateContextMenu($mylist)
    $Copy2Clip = GUICtrlCreateMenuItem('Copy2Clip', $Context)
    $close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25)

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

    GUISetState()

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

    $msg = 0
    While $msg <> $GUI_EVENT_CLOSE
    $msg = GUIGetMsg()

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

    Select
    Case $msg = $Copy2Clip
    ClipPut(GUICtrlRead($mylist))
    Case $msg = $add
    GUICtrlSetData($mylist, "You clicked button No1|")
    Case $msg = $clear
    GUICtrlSetData($mylist, "")
    Case $msg = $close
    MsgBox(0, "", "the closing button has been clicked", 2)
    Exit
    EndSelect
    WEnd
    EndFunc ;==>Example

    [/autoit]