Koda FormDesigner verzweifelung

  • Hallo Leute,

    RB = Radiobutton
    ich habe wieder mal ein problem, unzwar geht es darum das ich in meinem Script drei radiobutton drinne habe... ich will jetzt dass wenn ich auf RB 1 klicke sich 3 neue buttons öffnen (normale press button) und wenn auf RB2 gekilckt wird, verschwinden die von RB1 und es kommen die Pressbuttons von RB2.

    Also

    RB1 = button a,b,c
    RB2 = button c,d,e
    RB3 = button f,g,h

    ich hoffe ich konnte es einwenig verständlich erklären :)

    mein script bis jetzt

    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=e:\meine programme\test\auto reg\form1.kxf
    $Form1_1 = GUICreate("Auto-Reg", 633, 454, 192, 114)
    $Radio1 = GUICtrlCreateRadio("Radio1", 16, 48, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label1 = GUICtrlCreateLabel("S/ EP", 48, 46, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    $Radio2 = GUICtrlCreateRadio("Radio1", 16, 120, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $Label2 = GUICtrlCreateLabel("C", 48, 118, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    $Radio3 = GUICtrlCreateRadio("Radio1", 16, 192, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label3 = GUICtrlCreateLabel("AD", 49, 191, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Radio1

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

    Case $Radio1

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

    Case $Radio3

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

    EndSwitch
    WEnd

    [/autoit][autoit][/autoit][autoit][/autoit]
  • Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=e:\meine programme\test\auto reg\form1.kxf
    $Form1_1 = GUICreate("Auto-Reg", 633, 454, 192, 114)
    $Radio1 = GUICtrlCreateRadio("Radio1", 16, 48, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label1 = GUICtrlCreateLabel("S/ EP", 48, 46, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    $Radio2 = GUICtrlCreateRadio("Radio2", 16, 120, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label2 = GUICtrlCreateLabel("C", 48, 118, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    $Radio3 = GUICtrlCreateRadio("Radio3", 16, 192, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label3 = GUICtrlCreateLabel("AD", 49, 191, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    $buttonA = GUICtrlCreateButton("A", 200, 48)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonB = GUICtrlCreateButton("B", 250, 48)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonC = GUICtrlCreateButton("C", 300, 48)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonD = GUICtrlCreateButton("D", 200, 120)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonE = GUICtrlCreateButton("E", 250, 120)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonF = GUICtrlCreateButton("F", 300, 120)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonG = GUICtrlCreateButton("G", 200, 192)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonH = GUICtrlCreateButton("H", 250, 192)
    GUICtrlSetState(-1, $GUI_HIDE)
    $buttonI = GUICtrlCreateButton("I", 300, 192)
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Radio1
    GUICtrlSetState($buttonA, $GUI_SHOW)
    GUICtrlSetState($buttonB, $GUI_SHOW)
    GUICtrlSetState($buttonC, $GUI_SHOW)
    GUICtrlSetState($buttonD, $GUI_HIDE)
    GUICtrlSetState($buttonE, $GUI_HIDE)
    GUICtrlSetState($buttonF, $GUI_HIDE)
    GUICtrlSetState($buttonG, $GUI_HIDE)
    GUICtrlSetState($buttonH, $GUI_HIDE)
    GUICtrlSetState($buttonI, $GUI_HIDE)
    Case $Radio2
    GUICtrlSetState($buttonA, $GUI_HIDE)
    GUICtrlSetState($buttonB, $GUI_HIDE)
    GUICtrlSetState($buttonC, $GUI_HIDE)
    GUICtrlSetState($buttonD, $GUI_SHOW)
    GUICtrlSetState($buttonE, $GUI_SHOW)
    GUICtrlSetState($buttonF, $GUI_SHOW)
    GUICtrlSetState($buttonG, $GUI_HIDE)
    GUICtrlSetState($buttonH, $GUI_HIDE)
    GUICtrlSetState($buttonI, $GUI_HIDE)
    Case $Radio3
    GUICtrlSetState($buttonA, $GUI_HIDE)
    GUICtrlSetState($buttonB, $GUI_HIDE)
    GUICtrlSetState($buttonC, $GUI_HIDE)
    GUICtrlSetState($buttonD, $GUI_HIDE)
    GUICtrlSetState($buttonE, $GUI_HIDE)
    GUICtrlSetState($buttonF, $GUI_HIDE)
    GUICtrlSetState($buttonG, $GUI_SHOW)
    GUICtrlSetState($buttonH, $GUI_SHOW)
    GUICtrlSetState($buttonI, $GUI_SHOW)
    EndSwitch
    WEnd

    [/autoit]

    So vielleicht?

    Gruß,
    UEZ

    PS: Friede sei mit dir

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯


  • ich werde es wohl so machen... danke dir

  • kann mir noch einer bitte sagen wie ich die buttons in Radio 1,2,3 programmiere? tuhe ich das noch in der schleife oder auserhalb ?

  • warum machst du es nicht einfach so

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <array.au3>
    #Region ### START Koda GUI section ### Form=e:\meine programme\test\auto reg\form1.kxf
    $Form1_1 = GUICreate("Auto-Reg", 633, 454, 192, 114)
    $Radio1 = GUICtrlCreateRadio("Radio1", 16, 48, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label1 = GUICtrlCreateLabel("S/ EP", 48, 46, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    $Radio2 = GUICtrlCreateRadio("Radio2", 16, 120, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label2 = GUICtrlCreateLabel("C", 48, 118, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    $Radio3 = GUICtrlCreateRadio("Radio3", 16, 192, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label3 = GUICtrlCreateLabel("AD", 49, 191, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)

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

    $x=200
    $y=48
    Global $array_button[9]
    For $i=0 to 8
    $array_button[$i]=GUICtrlCreateButton(Chr(65+$i),$x,$y)
    GUICtrlSetState(-1, $GUI_hide)
    $x=$x+50
    If $x=350 Then
    $x=200
    $y=$y+72
    EndIf
    Next
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Radio1
    le_checker(1)
    Case $Radio2
    le_checker(2)
    Case $Radio3
    le_checker(3)
    EndSwitch
    WEnd

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

    Func le_checker($input)
    For $i=0 To UBound($array_button)-1
    GUIctrlSetState($array_button[$i],$GUI_hide)
    Next
    For $i=$input*3-3 To $input*3-1
    GUIctrlSetState($array_button[$i],$GUI_show)
    Next
    EndFunc

    [/autoit]

  • sieht auch sehr gut aus vielen dank :)
    kannst du mir vllt. jetzt noch sagen wie ich die buttons programmiere ? zb. wenn unter radio1 button1 gedrückt wurde soll eine msgbox erscheinen... kannst du mir bitte helfen =?

  • Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <array.au3>
    #Region ### START Koda GUI section ### Form=e:\meine programme\test\auto reg\form1.kxf
    $Form1_1 = GUICreate("Auto-Reg", 633, 454, 192, 114)
    $Radio1 = GUICtrlCreateRadio("Radio1", 16, 48, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label1 = GUICtrlCreateLabel("S/ EP", 48, 46, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    $Radio2 = GUICtrlCreateRadio("Radio2", 16, 120, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label2 = GUICtrlCreateLabel("C", 48, 118, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)
    $Radio3 = GUICtrlCreateRadio("Radio3", 16, 192, 17, 25)
    GUICtrlSetColor(-1, 0xFFFFE1)
    $Label3 = GUICtrlCreateLabel("AD", 49, 191, 120, 34)
    GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
    GUICtrlSetColor(-1, 0x0A246A)

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

    $x=200
    $y=48
    Global $array_button[9]
    For $i=0 to 8
    $array_button[$i]=GUICtrlCreateButton(Chr(65+$i),$x,$y)
    GUICtrlSetState(-1, $GUI_hide)
    $x=$x+50
    If $x=350 Then
    $x=200
    $y=$y+72
    EndIf
    Next
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Radio1
    le_checker(1)
    Case $Radio2
    le_checker(2)
    Case $Radio3
    le_checker(3)
    Case $array_button[0] to $array_button[8]
    MsgBox(0,"","Es wurde Button" &$nMsg& " gedrückt")
    EndSwitch
    WEnd

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

    Func le_checker($input)
    For $i=0 To UBound($array_button)-1
    GUIctrlSetState($array_button[$i],$GUI_hide)
    Next
    For $i=$input*3-3 To $input*3-1
    GUIctrlSetState($array_button[$i],$GUI_show)
    Next
    EndFunc

    [/autoit]