AutoIt GUI vergrößern

05/29/2013 16:09 .yorliK#1
Ich möchte mein GUI in der Länge vergrößern lassen wenn ein Button gedrückt wird. Weil ich eine Editbox nur anzeigen lassen will, wenn die auch gebraucht wird.

Ich habe schon einen Code zusammen gebastelt das das GUI vergrößert, aber der Code streckt nur das ganze Programm, somit wird erst gar keine Editbox angezeigt..

PHP Code:
Func _Editbox()
Global 
$F = True
Local $size 
= WinGetPos("[active]")
If 
$f Then
                GUICtrlSetData
($Button8, "Hide")
                For 
$i = 345 To 583 Step 5
                    WinMove
($Form1, "", $size[0], $size[1] , $i, 190) ; Länge von 345 auf 583 setzen
                    Sleep
(1)
                
Next
            
Else
                
GUICtrlSetData($Button8, "Show")
                For 
$i = 583 To 345 Step - 5
                    WinMove
($Form1, "", $size[0], $size[1], $i, 190) ; Länge zurück auf 345 setzen
                    Sleep
(1)
                
Next
            
EndIf
            
$f = Not $f
EndFunc 
;==> _Editbox() 
#Jede gute Antwort = Thanks#

MfG
Kilroy.
05/29/2013 18:26 omer36#2
z. B. mit dem befehl GUICtrlSetResizing()..

hier kleines beispiel:
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 165, 142, 190, 125)
$Input1 = GUICtrlCreateInput("Input1", 8, 16, 121, 21)
GUICtrlSetResizing(-1, 802)
$Input2 = GUICtrlCreateInput("Input2", 8, 64, 121, 21)
GUICtrlSetResizing(-1, 802)
$Input3 = GUICtrlCreateInput("Input3", 8, 112, 121, 21)
GUICtrlSetResizing(-1, 802)
$Button1 = GUICtrlCreateButton(">", 144, 16, 17, 113, $WS_GROUP)
GUICtrlSetResizing(-1, 802)
$Edit1 = GUICtrlCreateEdit("", 168, 16, 201, 113)
GUICtrlSetResizing(-1, 802)
GUICtrlSetData(-1, "Edit1")
GUICtrlSetResizing(-1, 802)
GUICtrlSetState($Edit1, @SW_HIDE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $bVisible = False

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



Func _winmove
()
Local $size = WinGetPos("Form1")
    If 
$bVisible = False Then
        WinMove
("Form1", "", $size[0], $size[1], 375, 165)
        
$bVisible = Not $bVisible
        GUICtrlSetState
($Edit1, @SW_SHOW)
        
GUICtrlSetData($Button1, "<")
    Else
        
WinMove("Form1", "", $size[0], $size[1], 175, 165)
        
$bVisible = Not $bVisible
        GUICtrlSetState
($Edit1, @SW_HIDE)
        
GUICtrlSetData($Button1, ">")
    EndIf
EndFunc 
vllt. gibt es noch eine methode, wo du nicht jedes element einzeln damit ansprechen musst... kannst ja mal googlen.. ^^
05/29/2013 23:58 KDeluxe#3
Code:
AutoItSetOption("GUIResizeMode", 802)