Jump to content

GUI


Recommended Posts

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 by anixon
Link to comment
Share on other sites

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?

Cheers

Ant..

Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...