Grosse Checkbox ?

  • Prajoss: Wie eine grosse Checkbox erstellen ?

    Antwort:

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

    ;i ja, man kann das Kästchen einer Checkbox größer machen !

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

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Big Checkbox", 242, 134, 193, 125)
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox basic", 32, 10, 145, 35)
    $Checkbox2 = GUICtrlCreateCheckbox("Grosse Checkbox", 32, 50, 145, 35, $BS_PUSHLIKE)
    $Checkbox3 = GUICtrlCreateCheckbox("&s", 32, 90, 145, 35, BitOR($BS_ICON, $BS_PUSHLIKE))
    GUICtrlSetImage(-1, "shell32.dll", 7)

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

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

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

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

    EndSwitch
    WEnd

    [/autoit]


    Viel Erfolg ! ;)

  • Ich hätte das so gemacht:

    Spoiler anzeigen
    [autoit]

    Opt("GUIOnEventMode",1)

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

    GUICreate("Test")
    GUISetOnEvent(-3,"_Exit")
    For $i= 1 to 10
    GUICtrlCreateCheckbox("",10,10+($i*30),25,25,0x1000)
    GUICtrlSetFont(-1,14)
    GUICtrlSetOnEvent(-1,"_Check")
    GUICtrlCreateLabel("CheckBox " & $i,45,13+($i*30),200,30)
    GUICtrlSetFont(-1,14)
    GUICtrlSetOnEvent(-1,"_CheckLabel")
    Next

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

    GUISetState()

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

    While 1
    Sleep(10)
    WEnd

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

    Func _Check()
    If GUICtrlRead(@GUI_CtrlId)=1 Then
    GUICtrlSetData(@GUI_CtrlId,"X")
    Else
    GUICtrlSetData(@GUI_CtrlId,"")
    EndIf
    EndFunc

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

    Func _CheckLabel()
    If GUICtrlRead(@GUI_CtrlId-1)=4 Then
    GUICtrlSetState(@GUI_CtrlId-1,1)
    GUICtrlSetData(@GUI_CtrlId-1,"X")
    Else
    GUICtrlSetState(@GUI_CtrlId-1,4)
    GUICtrlSetData(@GUI_CtrlId-1,"")
    EndIf
    EndFunc

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

    Func _Exit()
    Exit
    EndFunc

    [/autoit]

    lgG

    Edit: Geht auch mit Klick auf den Text...