Sign in to follow this  
Followers 0
jfcby

Label with border display no text

4 posts in this topic

Hi,

My label is not showing text or background color is not changing. I've looked the Help File under "GUICtrlCreateLabel", Controls Styles Appendix, and research the Forum but did not find a solution to my problem.

How does the code need to be modified to display the text in the label and change the background color?

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

LabelEx()

Func LabelEx()
Local $msg

GUICreate("My GUI state"); will create a dialog box that when displayed is centered

GUICtrlCreateLabel("aaaa", 125, 100, 186, 95, $SS_BLACKFRAME)
GUICtrlSetBkColor(-1, 0xFC0000)

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc

Thank you for your help,

jfcby


Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Remove $SS_BLACKFRAME

Edit:

If you have to have the frame:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

LabelEx()

Func LabelEx()
    GUICreate(\"My GUI state\"); will create a dialog box that when displayed is centered
    _GUICtrlCreateLabel_BlackFrame(\"aaaa\", 125, 100, 186, 95)
    GUICtrlSetBkColor(-1, 0xFF0000)

    GUISetState()
    ; Run the GUI until the dialog is closed
    While GUIGetMsg() <> -3
    WEnd
EndFunc

Func _GUICtrlCreateLabel_BlackFrame($s_text, $i_left, $i_top, $i_width = -1, $i_height = -1, $i_style = -1, $i_exstyle = -1)
    GUICtrlCreateLabel(\"\", $i_left - 1, $i_top - 1, $i_width + 2, $i_height + 2, 0x07)
    Return GUICtrlCreateLabel($s_text, $i_left, $i_top, $i_width, $i_height, $i_style, $i_exstyle)
EndFunc
Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

How do you put a color border around the label but no background color? I thought you used "$SS_BLACKFRAME".

Thank you for your help,

jfcby


Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Share this post


Link to post
Share on other sites

How do you put a color border around the label but no background color? I thought you used "$SS_BLACKFRAME".

Thank you for your help,

jfcby

Same concept:
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

LabelEx()

Func LabelEx()
    GUICreate("My GUI state"); will create a dialog box that when displayed is centered
    _GUICtrlCreateLabel_ColorBorder(0xFF0000, "aaaa", 125, 100, 186, 95)

    GUISetState()
    ; Run the GUI until the dialog is closed
    While GUIGetMsg() <> -3
    WEnd
EndFunc

Func _GUICtrlCreateLabel_ColorBorder($i_color, $s_text, $i_left, $i_top, $i_width = -1, $i_height = -1, $i_style = -1, $i_exstyle = -1)
    GUICtrlCreateLabel("", $i_left - 1, $i_top - 1, $i_width + 2, $i_height + 2)
    GUICtrlSetBkColor(-1, 0xFF0000)
    Return GUICtrlCreateLabel($s_text, $i_left, $i_top, $i_width, $i_height, $i_style, $i_exstyle)
EndFunc
1 person likes this

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0