Ghost21 Posted October 25, 2010 Share Posted October 25, 2010 I'm trying to get my GUI to work correctley. When I move it from one screen size of 1280x1024 to a screen 1024x768 or smaller the gui doesn't fit. I have a main image up front or the top layer then buttons hidden behind that then the form below that. The problem is that I want to beable to resize the GUI with the picture and the buttons so they all scale at the same rate ? or have it auto resize to whatever screen its on ?? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 25, 2010 Moderators Share Posted October 25, 2010 Ghost21,Welcome to the wonderful world of GUICtrlSetResizing. I will "leave the joy of discovery to you"*! M23* {c} 2010 enaiman Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
GEOSoft Posted October 25, 2010 Share Posted October 25, 2010 Create the GUI with sizes relative to the desktop size and then do as M23 suggested. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
cbruce Posted October 25, 2010 Share Posted October 25, 2010 Hi Ghost21 -- here is a small example (that I used for a different post yesterday) that resizes the way that you want: expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <DateTimeConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIResizeMode", $GUI_DOCKAUTO) #Region ### START Koda GUI section ### Form= $Form1_ID = GUICreate("Win_Title", 1012, 200, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX,$WS_THICKFRAME)) GUISetFont(10, 400, 0, "MS Sans Serif") $btn_Now_ID = GUICtrlCreateButton("Now", 16, 24, 57, 24) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $date_From_ID = GUICtrlCreateDate("2010/10/24 19:45:1", 152, 8, 185, 21) GUICtrlSetFont(-1, 9, 400, 0, "Courier") $date_To_ID = GUICtrlCreateDate("2010/10/24 19:45:1", 152, 40, 185, 21) GUICtrlSetFont(-1, 9, 400, 0, "Courier") $inp_SpanHHmm_ID = GUICtrlCreateInput("", 424, 8, 81, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY)) GUICtrlSetFont(-1, 12, 400, 0, "Courier") $inp_SpanMinutes_ID = GUICtrlCreateInput("", 424, 40, 81, 24) GUICtrlSetFont(-1, 12, 400, 0, "Courier") $cbo_Channel_ID = GUICtrlCreateCombo("", 642, 8, 207, 25) GUICtrlSetData(-1, "") GUICtrlSetFont(-1, 12, 400, 0, "Courier") $btn_Clear_TVShow_Filename_ID = GUICtrlCreateButton("Clear", 17, 80, 57, 24) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $txt_TVShow_Filename_ID = GUICtrlCreateEdit("", 152, 72, 841, 48) GUICtrlSetData(-1, "") GUICtrlSetFont(-1, 10, 400, 0, "Courier") $lbl_Start_ID = GUICtrlCreateLabel("Start", 94, 8, 39, 23) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $lbl_Stop_ID = GUICtrlCreateLabel("Stop", 94, 40, 38, 23) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $lbl_HHmm_ID = GUICtrlCreateLabel("HH:mm", 352, 8, 63, 23) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $lbl_Minutes_ID = GUICtrlCreateLabel("Minutes", 351, 40, 63, 23) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $lbl_Channel_ID = GUICtrlCreateLabel("Channel", 560, 8, 71, 23) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $lbl_File_xxx_ID = GUICtrlCreateLabel("File -", 94, 72, 55, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $lbl_xxx_Name_ID = GUICtrlCreateLabel("Name", 94, 90, 55, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $lbl_Device = GUICtrlCreateLabel("Device", 560, 40, 71, 23) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") ; ???????????????????? ; These Radio Buttons act as a "group" (only one selected at a time, etc.), ; even though there is no GUICtrlCreateGroup() or GUIStartGroup()... ; ???????????????????? ;GUIStartGroup() $rad_PVR = GUICtrlCreateRadio("PVR", 640, 40, 49, 17) GUICtrlSetState(-1, $GUI_CHECKED) $rad_VCR = GUICtrlCreateRadio("VCR", 704, 40, 49, 17) $rad_DVR = GUICtrlCreateRadio("DVR", 768, 40, 49, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Form1_ID Case $btn_Now_ID Case $date_From_ID Case $date_To_ID Case $inp_SpanHHmm_ID Case $inp_SpanMinutes_ID Case $cbo_Channel_ID Case $btn_Clear_TVShow_Filename_ID Case $txt_TVShow_Filename_ID Case $rad_PVR MsgBox( 0, "Event", "$rad_PVR", 1) Case $rad_VCR MsgBox( 0, "Event", "$rad_VCR", 1) Case $rad_DVR MsgBox( 0, "Event", "$rad_DVR", 1) EndSwitch WEnd The two main things are the: Opt("GUIResizeMode", $GUI_DOCKAUTO) ... and the $WS_SIZEBOX and $WS_THICKFRAME properties on the GUICreate(): $Form1_ID = GUICreate("Win_Title", 1012, 200, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX,$WS_THICKFRAME)) HTH, CBruce Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now