Ontosy Posted December 24, 2011 Posted December 24, 2011 I can make sure that when I maximize a form, including text also become larger in proportion ?
Moderators Melba23 Posted December 24, 2011 Moderators Posted December 24, 2011 Ontosy, This only works for changes in width, but it gives you the idea of how you might go about it: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test", 500, 500, -1, -1, BitOR($WS_SIZEBOX, $WS_SYSMENU, $WS_MINIMIZEBOX)) $hLabel = GUICtrlCreateLabel("", 0, 0, 200, 200) GUICtrlSetData(-2, "This is a test of the text size increasing function") GUICtrlSetBkColor(-1, 0x00FF00) GUICtrlSetFont(-1, 20) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUISetState() GUIRegisterMsg($WM_SIZE, "_WM_SIZE") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) ; If it is our GUI If $hWnd = $hGUI Then ; Get the new size of the GUI $iGUIWidth = BitAND($lParam, 0xFFFF) $iGUIHeight = BitShift($lParam, 16) ; Determine ratio $nRatio = $iGUIWidth / 500 ; Determine new font size $iFontSize = Round(20 * $nRatio) ; Alter label font size GUICtrlSetFont($hLabel, $iFontSize) EndIf EndFunc ;==>_WM_SIZE Please let us see any developments that you make - particularly using both directions. M23 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
Ontosy Posted December 24, 2011 Author Posted December 24, 2011 ty, it work good but now i have problem with: GUICtrlCreateGraphic(8, 8, 272, 92, _ BitOR($SS_CENTER,$SS_RIGHT,$SS_BLACKRECT,$SS_GRAYRECT,$SS_WHITERECT, _ $SS_BLACKFRAME,$SS_NOTIFY,$SS_SUNKEN,$WS_GROUP)) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) Graphic not resize.
Moderators Melba23 Posted December 24, 2011 Moderators Posted December 24, 2011 Ontosy,I do not think the contents of Graphic controls can be resized with GUICtrlSetResizing - the control itself resizes but not the contents. M23 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
Ontosy Posted December 24, 2011 Author Posted December 24, 2011 To me it's enough that the graphic control, which is empty, itself resizes, but does not.
Moderators Melba23 Posted December 24, 2011 Moderators Posted December 24, 2011 Ontosy,Then I suggest you simplify the style statement a bit - you have a number of mutually incompatible styles in there. I sugges tusing just one of each of these groups:$SS_CENTER,$SS_RIGHT$SS_BLACKRECT,$SS_GRAYRECT,$SS_WHITERECTThis script resizes the graphic control for me: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> $hGUI = GUICreate("Test", 500, 500, -1, -1, BitOR($WS_SIZEBOX, $WS_SYSMENU, $WS_MINIMIZEBOX)) $hGraphic = GUICtrlCreateGraphic(0, 0, 200, 200, BitOR($SS_CENTER, $SS_BLACKFRAME, $SS_NOTIFY, $SS_SUNKEN)) GUICtrlSetColor(-1, 0) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000, 0xff0000) GUICtrlSetGraphic(-1, $GUI_GR_PIE, 50, 50, 40, 30, 270) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x00ff00, 0xffffff) GUICtrlSetGraphic(-1, $GUI_GR_PIE, 58, 50, 40, -60, 90) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndDoes it for you? M23 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
Ontosy Posted December 24, 2011 Author Posted December 24, 2011 Now resize the border but not the background color, Do it is possible also?
Moderators Melba23 Posted December 25, 2011 Moderators Posted December 25, 2011 Ontosy, I think not, but someone else might know differently. M23 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
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