Jump to content
Sign in to follow this  
sublimnl

Help Resizing GUI

Recommended Posts

sublimnl

Is it possible to resize a GUI by clicking a button in the GUI? I am writing a logon script manager for my company...initially the gui will just show the company logo and a quick line of text showing the current status of things. At the right side of the window I have a button that says "More >>". When the user clicks that button I want to expand the window downwards to reveal a full log of what is going on as well as user-defined options in another tab. How can I make the button resize the GUI?

Share this post


Link to post
Share on other sites
rogdog

This should do what you need :whistle:

#include <GUIConstants.au3>

$Window = GUICreate("My GUI",400,400)  
$Button = GUICtrlCreateButton("More >>",280,360,100,30)
GUICtrlSetResizing ( $Button,$GUI_DOCKALL)
GUISetState (@SW_SHOW)      

$Size = WinGetPos  ($Window)

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()

    if $msg = $Button and guictrlread($Button) = "More >>" then 
        Winmove($Window,"",default,default,800,$Size[3])    
        GUICtrlSetData($Button,"<< Less")
    ElseIf $msg = $Button and guictrlread($Button) = "<< Less" then 
        Winmove($Window,"",default,default,400,$Size[3])    
        GUICtrlSetData($Button,"More >>")
    EndIf
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

My Scripts[topic="73325"]_ReverseDNS()[/topic]Favourite scripts by other members[topic="81687"]SNMP udf[/topic][topic="70759"]Using SNMP - MIB protocol[/topic][topic="39050"]_SplitMon:Section off your monitor!, split your monitor into sections for easy management[/topic][topic="73425"]ZIP.au3 UDF in pure AutoIt[/topic][topic="10534"]WMI ScriptOMatic tool for AutoIt[/topic][topic="51103"]Resources UDF embed/use any data/files into/from AutoIt compiled EXE files[/topic]

Share this post


Link to post
Share on other sites
sublimnl

will give it a shot. Thanks!

Share this post


Link to post
Share on other sites
sublimnl

Thanks, that worked!

Edited by sublimnl

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×