Jump to content
Sign in to follow this  
ttleser

Gui Tab resizing

Recommended Posts

ttleser

Is it possible to be able to click on a tab within a GUI window and have the GUI resize itself?

Say you've got a Basic tab and an Advanced tab. When you open the program, the Basic tab is default and the gui is small, you click on the Advanced tab and the GUI expands..

I can figure out how to make the GUI expand by clicking on a button, but can't figure out how to do it based on clicking on the tab itself.

Thoughts?

Share this post


Link to post
Share on other sites
covaks

#include <GuiConstants.au3>

$hWnd = GuiCreate("My Gui")

$hTab1 = GUICtrlCreateTab(2,2,390,390)
$hTabItem1 = GUICtrlCreateTabItem("Basic")
$hTabItem2 = GUICtrlCreateTabItem("Advanced")

GUISetState()

$pos = WinGetPos($hWnd)

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
    If $msg = $hTab1 Then
        If GUICtrlRead($hTab1) = 0 Then
            WinMove($hWnd,"",Default,Default,$pos[2],$pos[3])
        ElseIf GuiCtrlRead($hTab1) = 1 Then
            WinMove($hWnd,"",Default,Default,600,600)
        EndIf
    EndIf
WEnd

Share this post


Link to post
Share on other sites
ttleser

Exactly what I was looking for.

Thanks much. :D

Share this post


Link to post
Share on other sites
Emiel Wieldraaijer

@covaks

Good example


Best regards,Emiel Wieldraaijer

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  

×