Jump to content

Fixed buttons in a GUI


 Share

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

Link to comment
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


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

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...