bekomms net hin

  • also habe ne gui jetzt mit 3 buttons,wenn ich auf einen button raufklicke sollen nochmal 3 buttons kommen und das selbe nochmal wäre dankbar für nen bissl hilfe oder halt etwas wo man nur was eintippen muss (z.b. zahlen und der dann was ausführt)


    #include <GUIConstants.au3>


    #Region ### START Koda GUI section ### Form=C:\Programme\AutoIt3\Neuer Ordner\Forms\Form1.kxf

    $Form1 = GUICreate("Form1", 633, 447, 193, 125)

    $Button1 = GUICtrlCreateButton("Button1", 40, 56, 65, 33, 0)

    $Button2 = GUICtrlCreateButton("Button2", 40, 96, 65, 33, 0)

    $Button3 = GUICtrlCreateButton("Button3", 40, 136, 65, 33, 0)

    GUISetState(@SW_SHOW)

    #EndRegion ### END Koda GUI section ###


    While 1

    $nMsg = GUIGetMsg()

    Switch $nMsg

    Case $GUI_EVENT_CLOSE

    Exit

    Case $Button1

    msgbox ( 0 , "Box" , "Ich bin Button1" )

    Case $Button2

    msgbox ( 0 , "Box" , "Ich bin Button2" )

    Case $Button3

    msgbox ( 0 , "Box" , "Ich bin Button3" )

    EndSwitch

    WEnd

  • wo du dei msgboxen hast musst du einfach GUICtrlCreateButtton("Button",10,10) hinschreiben aber mit verschiedenen Kordinaten

  • Also, ich würde dir hier zum, OnEventMode raten.
    Hinweis: Benutze die [ autoit]-Tags (ohne Leerzeichen)
    Probier mal das hier:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    Opt("GUIOnEventMode",1)
    Global $buttons=0

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

    #Region ### START Koda GUI section ### Form=C:\Programme\AutoIt3\Neuer Ordner\Forms\Form1.kxf

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

    $Form1 = GUICreate("Form1", 633, 447, 193, 125)

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

    $Button1 = GUICtrlCreateButton("+", 40, 56, 65, 33, 0)

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

    GUISetState(@SW_SHOW)

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

    #EndRegion ### END Koda GUI section ###

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

    GUISetOnEvent($GUI_EVENT_CLOSE,"_CLOSE")
    GUICtrlSetOnEvent($Button1,"_add")
    While 1

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

    Sleep(100)
    WEnd
    Func _CLOSE()
    Exit
    EndFunc
    Func _add()
    $buttons=$buttons+1
    GUICtrlCreateButton("button " & $buttons,40,56+$buttons*40,65,33)
    GUICtrlSetOnEvent(-1,"_CLICK")
    EndFunc
    Func _CLICK()
    MsgBox(0,"","Button " & @GUI_CtrlId-3)
    EndFunc

    [/autoit]

    Twitter: @L3viathan2142
    Benutze AutoIt persönlich nicht mehr, da ich keinen Windows-Rechner mehr besitze.

  • ja ok hab das jetzt mit OnEventModegemacht aber wenn ich da etwas anklicke kommen die buttons(ja soll so sein) aber wenn man sich mal verklickt hat und die buttons wieder weg haben will geht das net die bleiben da und das sollen se nicht und es steht hinter fast jeden button ein 2 da soll aber nix stehen naja seht es euch an


    #include <GUIConstants.au3>
    Opt("GUIOnEventMode",4)
    Global $buttons=2

    #Region ### START Koda GUI section ### Form=C:\Programme\AutoIt3\Neuer Ordner\Forms\Form1.kxf

    $Form1 = GUICreate("Form1", 633, 447, 193, 125)

    $Button_1 = GUICtrlCreateButton("hallo", 40, 56, 65, 33, 0)
    GUISetState(@SW_SHOW)

    #EndRegion ### END Koda GUI section ###

    GUISetOnEvent($GUI_EVENT_CLOSE,"_CLOSE")
    GUICtrlSetOnEvent($Button_1,"_add")
    While 1

    Sleep(100)
    WEnd
    Func _CLOSE()
    Exit
    EndFunc
    Func _add()
    $buttons=$buttons+0
    GUICtrlCreateButton("Pimper " & $buttons,40,40+$buttons*40,65,33)
    GUICtrlSetOnEvent(-1,"_CLICK1")
    GUICtrlCreateButton("button2 " & $buttons,40,80+$buttons*40,65,33)
    GUICtrlSetOnEvent(-1,"_CLICK2")
    GUICtrlCreateButton("button3 " & $buttons,40,120+$buttons*40,65,33)
    GUICtrlSetOnEvent(-1,"_CLICK3")
    GUICtrlCreateButton("button4 " & $buttons,40,160+$buttons*40,65,33)
    GUICtrlSetOnEvent(-1,"_CLICK4")


    EndFunc
    Func _CLICK1()
    GUICtrlCreateButton("Ch 1 " & $buttons,120,40+$buttons*40,65,33)
    GUICtrlSetOnEvent(-1,"_CLICK1")
    GUICtrlCreateButton("Ch 2 " & $buttons,120,80+$buttons*40,65,33)
    GUICtrlSetOnEvent(-1,"_CLICK2")
    GUICtrlCreateButton("Ch 3 " & $buttons,120,120+$buttons*40,65,33)
    GUICtrlSetOnEvent(-1,"_CLICK3")
    GUICtrlCreateButton("Ch 4 " & $buttons,120,160+$buttons*40,65,33)
    EndFunc

    Func _CLICK2()

    EndFunc

    Func _CLICK3()

    EndFunc

    Func _CLICK4()

    EndFunc

    Einmal editiert, zuletzt von spaki (1. Juni 2009 um 14:04)

  • Also mit dem löschen hab ich noch schwierichkeiten aber vieleicht bekommt es jemand anderes hin :thumbup:
    hir ma mein skript :

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    Opt("GUIOnEventMode",1)
    Global $buttons=0

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

    #Region ### START Koda GUI section ### Form=C:\Programme\AutoIt3\Neuer Ordner\Forms\Form1.kxf

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

    $Form1 = GUICreate("Form1", 633, 447, 193, 125)

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

    $Button1 = GUICtrlCreateButton("+", 40, 56, 65, 33, 0)
    $Button2 = GUICtrlCreateButton("-",150,56,65,33,0)

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

    GUISetState(@SW_SHOW)

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

    #EndRegion ### END Koda GUI section ###

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

    GUISetOnEvent($GUI_EVENT_CLOSE,"_CLOSE")
    GUICtrlSetOnEvent($Button1,"_add")
    GUICtrlSetOnEvent($Button2,"_addss")
    While 1

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

    Sleep(100)
    WEnd
    Func _CLOSE()
    Exit
    EndFunc
    Func _add()
    $buttons=$buttons+1
    GUICtrlCreateButton("button " & $buttons,40,56+$buttons*40,65,33)
    GUICtrlSetOnEvent(-1,"_CLICK")
    EndFunc
    Func _addss()
    $buttons=$buttons +1
    GUICtrlDelete($buttons)
    GUICtrlSetOnEvent(+1,"_CLICK")
    EndFunc

    Func _CLICK()
    MsgBox(0,"","Button " & @GUI_CtrlId-3)
    EndFunc

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


    vielicht hilft es dir ja :D