Jump to content
Sign in to follow this  

Fixed buttons in a GUI

Recommended Posts


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=
$Button1 = GUICtrlCreateButton("AButton1", 40, 32, 73, 33, 0)
GUICtrlSetResizing (-1,$GUI_DOCKALL)
$Button2 = GUICtrlCreateButton("AButton2", 128, 32, 73, 33, 0)
GUICtrlSetResizing (-1,$GUI_DOCKALL)
#EndRegion ### END Koda GUI section ###

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


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

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.