Sign in to follow this  
Followers 0
Cyberworld

Fixed buttons in a GUI

4 posts in this topic

Is it posible to have fixed buttons in a GUI? With 'fixed' do I mean that the buttons keep their size and distance then I change the size of the window. I have been able to keep the size of the buttons but the distance between the buttons increases if I make the window larger, and vice versa if I make it smaller. If the window gets too small the buttons will eventually overlap each other :P

Share this post


Link to post
Share on other sites



#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 633, 447, 193, 115, BitOR($WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_POPUPWINDOW,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
$Button1 = GUICtrlCreateButton("AButton1", 40, 32, 73, 33, 0)
GUICtrlSetResizing (-1,$GUI_DOCKALL)
$Button2 = GUICtrlCreateButton("AButton2", 128, 32, 73, 33, 0)
GUICtrlSetResizing (-1,$GUI_DOCKALL)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

couple things to look at in the help

Option: GUIResizeMode

Function: GUICtrlSetResizing


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks that fixed the problem with the distance between the buttons. :D

I did try "GUICtrlSetResizing" and GUIResizeMode but did not find the right combination to make it work because I just used it with GUICtrlCreateInput funktion, not on each of the "GUICtrlCreateButton" calls :nuke:

This give me hope that I can do the same with the vertical distance :P

Yes it worked: GUICtrlSetResizing (-1,$GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKSIZE) :)

Edited by Cyberworld

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  
Followers 0