AndyS01 Posted February 4, 2016 Posted February 4, 2016 I would like to center the text on a Group box (GUICtrlCreateGroup()) along its top horizontal line, but I can't find any examples of this. Can this be done? Example script: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Example() Func Example() Local $flags = 0, $iMsg = 0 GUICreate("My GUI group") $flags = BitOR($flags, $WS_THICKFRAME) $flags = BitOR($flags, $ES_CENTER) GUICtrlCreateGroup("Group 1", 10, 20, 190, 140, $flags) ; I want to cnter "Group 1" GUICtrlCreateRadio("Radio 1", 20, 50, 50, 20) GUICtrlCreateRadio("Radio 2", 20, 70, 60, 50) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 $iMsg = GUIGetMsg() If $iMsg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example
InunoTaishou Posted February 4, 2016 Posted February 4, 2016 (edited) The group control is just a button so you need to use a button style flag and include the ButtonConstants.au3 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> Example() Func Example() Local $flags = 0, $iMsg = 0 GUICreate("My GUI group") GUICtrlCreateGroup("Group 1", 10, 20, 190, 140, BitOr($WS_THICKFRAME, $BS_CENTER)) ; I want to cnter "Group 1" GUICtrlCreateRadio("Radio 1", 20, 50, 50, 20) GUICtrlCreateRadio("Radio 2", 20, 70, 60, 50) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 $iMsg = GUIGetMsg() If $iMsg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example Edited February 4, 2016 by InunoTaishou Xandy 1
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