anixon Posted August 24, 2008 Posted August 24, 2008 This code creates a sunken box filled with a white rectangle however the text is not displayed [covered by the white rectangle] how do you make the text appear [left justified] within the box so that the label has the same appearance as if it was an input box. CODE#include <GUIConstantsEx.au3> #include <StaticConstants.au3> Example() Func Example() Local $msg GUICreate("My GUI state") ; will create a dialog box that when displayed is centered GUICtrlCreateLabel("My Text", 10, 17,100,20, $SS_SUNKEN + $SS_WHITERECT) GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example Help is always appreciated Ant..
anixon Posted August 24, 2008 Author Posted August 24, 2008 I think that I have probably answered my own question with the following code: CODEGUICtrlCreateLabel("",8,100,245,20) GUICtrlSetBkColor(-1,0xFFFFFF) ; White GUICtrlCreateLabel(" Title " ,8,105,245,20) GUICtrlSetBkColor(-1,0xFFFFFF) ; White GUICtrlCreateLabel("",8,100,245,25,$SS_GRAYFRAME) It seems quite convoluted but appear to work. Ant..
rasim Posted August 25, 2008 Posted August 25, 2008 anixonExample:#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Example() Func Example() Local $msg GUICreate("My GUI state") ; will create a dialog box that when displayed is centered GUICtrlCreateLabel("My Text", 10, 17,100,20, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example
anixon Posted August 25, 2008 Author Posted August 25, 2008 (edited) anixon Example: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Example() Func Example() Local $msg GUICreate("My GUI state") ; will create a dialog box that when displayed is centered GUICtrlCreateLabel("My Text", 10, 17,100,20, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example Excellent that works an absolute treat and thank you for showing me how BitOR works as I am pretty sure that GUICtrlCreateLabel documentation does have a reference to it but there are no examples as to how it is formated within the statement. Thanks again.. Ant.. Edited August 25, 2008 by anixon
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