Tiboi Posted June 4, 2010 Share Posted June 4, 2010 (edited) hi all. is it possible to re-size a form while its open through the click of a button? i have no code for this cause i could get no info on how to do it. here is what i want to do: 1. this is the normal form #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form1", 155, 122, 653, 431) $Button1 = GUICtrlCreateButton("Redesign", 40, 88, 75, 25) $Input1 = GUICtrlCreateInput("Input1", 16, 8, 121, 21) $Input2 = GUICtrlCreateInput("Input2", 16, 32, 121, 21) $Combo1 = GUICtrlCreateCombo("Combo1", 16, 64, 121, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd 2. when i press the button i want to do this: #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form1", 155, 202, 653, 431) $Button1 = GUICtrlCreateButton("Redesign", 40, 168, 75, 25) $Input1 = GUICtrlCreateInput("Input1", 16, 8, 121, 21) $Input2 = GUICtrlCreateInput("Input2", 16, 32, 121, 21) $Combo1 = GUICtrlCreateCombo("Combo1", 16, 144, 121, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Edit1 = GUICtrlCreateEdit("", 16, 64, 121, 73) GUICtrlSetData(-1, "Edit1") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd any help will be appreciated.. Edited June 4, 2010 by Tiboi Link to comment Share on other sites More sharing options...
BrettF Posted June 4, 2010 Share Posted June 4, 2010 Doesn't work as well as I wish, but it should stand as a basic starting point for you. expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $large = False $Form2 = GUICreate("Form1", 155, 122, 653, 431) $Button1 = GUICtrlCreateButton("Redesign", 40, 88, 75, 25) $Input1 = GUICtrlCreateInput("Input1", 16, 8, 121, 21) $Input2 = GUICtrlCreateInput("Input2", 16, 32, 121, 21) $Combo1 = GUICtrlCreateCombo("Combo1", 16, 64, 121, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Edit1 = GUICtrlCreateEdit("", 16, 64, 121, 73) GUICtrlSetData(-1, "Edit1") GUICtrlSetState (-1, $GUI_HIDE + $GUI_DISABLE) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _Redesign() EndSwitch WEnd Func _Redesign() If $large = False Then WinMove ($Form2, "", Default, Default, 155, 202) GUICtrlSetPos ($Button1, 40, 168) GUICtrlSetPos ($Combo1, 16, 144) GUICtrlSetState ($Edit1, $GUI_SHOW + $GUI_ENABLE) $large = True Else WinMove ($Form2, "", Default, Default, 155, 122) GUICtrlSetPos ($Button1, 40, 88) GUICtrlSetPos ($Combo1, 16, 64) GUICtrlSetState ($Edit1, $GUI_HIDE + $GUI_DISABLE) $large = False EndIf EndFunc Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Tiboi Posted June 6, 2010 Author Share Posted June 6, 2010 thanks BrettF. i cant get it to display properly yet but hopefully i will. Link to comment Share on other sites More sharing options...
Makaule Posted June 6, 2010 Share Posted June 6, 2010 You may resize any GUI with WinMove. For docking GUI elements in some place, keeping same size you could use GUICtrlSetResizing. Link to comment Share on other sites More sharing options...
Tiboi Posted June 7, 2010 Author Share Posted June 7, 2010 You may resize any GUI with WinMove. For docking GUI elements in some place, keeping same size you could use GUICtrlSetResizing.ok thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now