anixon Posted July 16, 2007 Share Posted July 16, 2007 (edited) Hi more of the mysteries and sciences of AutoIT mission to code a displaybox with text 1 this does not work: GUICtrlCreateLabel($supplier & " - " & $Title,12,105,350,25, $SS_GRAYFRAME) however if you create the label twice like the following code 2 this works: GUICtrlCreateLabel($supplier & " - " & $Title,12,105,350,25) GUICtrlCreateLabel("",8,100,245,25, $SS_GRAYFRAME) What do you have to do to make the first option (1) work as it is not obvious in Help? Ant.. Edited July 16, 2007 by anixon Link to comment Share on other sites More sharing options...
Lazycat Posted July 16, 2007 Share Posted July 16, 2007 Option 1 will not work, $SS_GRAYFRAME and other "*FRAME" and "*RECT" styles does not display text at all. In your second code you overlap labels and see frame from first label and text from second. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
anixon Posted July 16, 2007 Author Share Posted July 16, 2007 Option 1 will not work, $SS_GRAYFRAME and other "*FRAME" and "*RECT" styles does not display text at all. In your second code you overlap labels and see frame from first label and text from second.Thanks for the comments is there an alternative or preferred method for showing text in a frame and is it possible to change the background color of the frame?CheersAnt.. Link to comment Share on other sites More sharing options...
anixon Posted July 16, 2007 Author Share Posted July 16, 2007 I have probably answered my own question to this support item. The mission was to create a rectangular box with a coloured background (colour of choice) and insert text that was left justified and horizontally centred in the box. This is the code that I came up with to achieve that outcome. CODE GUICtrlCreateLabel("",8,100,245,20) GUICtrlSetBkColor(-1,0x00ff00) ; Green GUICtrlCreateLabel(" " & $Title,8,105,245,20) GUICtrlSetBkColor(-1,0x00ff00) ; Green GUICtrlCreateLabel("",8,100,245,25, $SS_GRAYFRAME) I would have thought that it would have been achievable with two lines of code however the positioning of the text within the box and the positioning of the colour background proved to be a bit of a challenge (refer to the Left, Top Width Height settings). Methodology that only required two lines of code pretty much eluded me. Cheers Ant... 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