GUI Label + Progressbar zentrieren

  • Hi,

    ich habe folgende GUI

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, 0)
    $Label1 = GUICtrlCreateLabel("Software wird geprüft", 96, 96, 259, 36, $SS_CENTER)
    GUICtrlSetFont(-1, 20, 400, 0, "Arial")
    $Progress1 = GUICtrlCreateProgress(72, 192, 374, 17)
    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]

    Wie man sieht wird das Form auf die größe des Bildschirmes maximiert. Nun möchte ich aber noch das das Label und die Progressbar auf diesem Form auch noch zentriert sind.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

    Einmal editiert, zuletzt von chip (6. August 2009 um 09:48)

    • Offizieller Beitrag

    Einfach die Position berechnen:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    $iWidth = @DesktopWidth
    $iHeight = @DesktopHeight
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("", $iWidth, $iHeight, 0, 0, $WS_POPUP)
    $Label1 = GUICtrlCreateLabel("Software wird geprüft", $iWidth / 2 - 150, $iHeight / 2 - 50, 300, 36, $SS_CENTER)
    GUICtrlSetFont(-1, 20, 400, 0, "Arial")
    $Progress1 = GUICtrlCreateProgress($iWidth / 2 - 150, $iHeight / 2 - 10, 300, 17)
    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]
  • Stimmt wenn man weiß wie, dann ist einfach ;). Dankeschön.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.