Gui Fenster richtig verkleinern!

  • Hey Leute,

    Ich hab ein problem mit Autoit :D
    Ich würde gerne eine Gui , ohne sie zu schließen, verkleinern. Ich hab das auch geschafft nur schaut das komisch aus :S!


    #include
    #include
    #include
    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Form2", 870, 163, 302, 218)
    $Button1 = GUICtrlCreateButton("Button1", 16, 80, 101, 49, $WS_GROUP)
    $Button2 = GUICtrlCreateButton("Button1", 392, 80, 101, 49, $WS_GROUP)
    $Button3 = GUICtrlCreateButton("Button1", 268, 80, 101, 49, $WS_GROUP)
    $Button4 = GUICtrlCreateButton("Button1", 136, 80, 101, 49, $WS_GROUP)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    Func Verkleinern ()
    Winmove ("Form2","","default","default", 509 , 163)
    EndFunc

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    Verkleinern ()
    EndSwitch
    WEnd


    Hoffe mir kann wer erklären wie es richtig gehört :D

    mfg

    Einmal editiert, zuletzt von XXlolimanxx (11. März 2010 um 17:52)

  • Hoffe mir kann wer erklären wie es richtig gehört :D

    bitte immer genauer erklären. Richtig kann alles mögiche sein^^
    Je nachdem wie du es willst.

    so könnte z.B. richtig sein:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Form2", 870, 163, 302, 218)
    $Button1 = GUICtrlCreateButton("Button1", 16, 80, 101, 49, $WS_GROUP)
    GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
    $Button2 = GUICtrlCreateButton("Button1", 392, 80, 101, 49, $WS_GROUP)
    GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
    $Button3 = GUICtrlCreateButton("Button1", 268, 80, 101, 49, $WS_GROUP)
    GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
    $Button4 = GUICtrlCreateButton("Button1", 136, 80, 101, 49, $WS_GROUP)
    GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

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

    Func Verkleinern()
    $pos = WinGetPos("Form2", "")
    WinMove("Form2", "", $pos[0], $pos[1], 509, 163)
    EndFunc ;==>Verkleinern

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    Verkleinern()
    EndSwitch
    WEnd

    [/autoit]
  • ... oder so könnte es richtig sein (//EDIT: 6 minuten... wow das ist hart.)

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Form2", 870, 163, 302, 218)
    $Button1 = GUICtrlCreateButton("Button1", 16, 80, 101, 49, $WS_GROUP)
    GUICtrlSetResizing(-1,$GUI_DOCKALL) ; Den Buttons muss gesagt werden, wie sie sich beim Resize verhalten sollen. Dockall = Keine veränderung.
    $Button2 = GUICtrlCreateButton("Button2", 136, 80, 101, 49, $WS_GROUP)
    GUICtrlSetResizing(-1,$GUI_DOCKALL)
    $Button3 = GUICtrlCreateButton("Button3", 268, 80, 101, 49, $WS_GROUP)
    GUICtrlSetResizing(-1,$GUI_DOCKALL)
    $Button4 = GUICtrlCreateButton("Button4", 392, 80, 101, 49, $WS_GROUP)
    GUICtrlSetResizing(-1,$GUI_DOCKALL)

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

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

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

    Func Verkleinern()
    WinMove($Form2, "", default, default, 509, 163) ; default darf nicht als String geschrieben werden!
    EndFunc ;==>Verkleinern

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    Verkleinern()
    EndSwitch
    WEnd

    [/autoit]