Jump to content

Goofy Result with GUI styles


 Share

Recommended Posts

I have no idea why this is happening, i have some labels that i am adding to my GUI and i want them centered text and etched frame. I did use "#include <StaticConstants.au3>" ....

I have a variable that i use to store the style.

$lStyle = BitOr($GUI_SS_DEFAULT_LABEL, $SS_CENTER)

^^works. Shows the text from the label centered.

$lStyle = BitOr($GUI_SS_DEFAULT_LABEL, $SS_ETCHEDFRAME)

^^doesnt work, shows the etched frame with no text inside

$lStyle = BitOr($GUI_SS_DEFAULT_LABEL, $SS_ETCHEDFRAME, $SS_CENTER)

^^doesnt work, cant see label at all!

Since the last example is what i want, and it doesnt show the label at all, im a bit worried im doing something wrong but i have looked at the documentation for creating labels several times. Can anyone help?

Link to comment
Share on other sites

Special graphical label setting exclude the label from displaying its text content. (if it still has it?)

You need to use two labels, one for the text and a other for the special graphic effect you like to display around it.

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

I've never had any luck with those styles either. I often use GUICtrlCreateGraphic() which allows you to play with border thickness or color.

#include <StaticConstants.au3>

GUICreate("My GUI")
GUICtrlCreatelabel("", 38, 28, 124, 18, $SS_ETCHEDFRAME)
GUICtrlCreatelabel("Fee Fie Foe Foobar", 40, 30, 120, 14, $SS_CENTER)
GUICtrlCreateGraphic(39, 59, 122, 16)
GUICtrlSetBkColor(-1, 0xA0A0A0)
GUICtrlCreatelabel("Fee Fie Foe Foobar", 40, 60, 120, 14, $SS_CENTER)
GUICtrlCreateGraphic(36, 96, 128, 22)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlCreatelabel("Fee Fie Foe Foobar", 40, 100, 120, 14, $SS_CENTER)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetBkColor(-1, 0xE0E0E0)
GUISetState()

While 1
    If GUIGetMsg() = -3 Then ExitLoop
Wend

edit: expanded example

Edited by Spiff59
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...