Label background color?

rfresh

Well-Known Member
Licensed User
Longtime User
Is there a Label background color property? I didn't see one in the Designer.

Thanks...
 

walterf25

Expert
Licensed User
Longtime User
label background color

Is there a Label background color property? I didn't see one in the Designer.

Thanks...

yes it is,
B4X:
label1.color = colors.transparent   'if you want the label to be transparent.
label1.textcolor = colors.blue   'color of text

cheers,
Walter
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
I didn't see one in the Designer.

Look at the attached Designer screenshot.
 

Attachments

  • Shot.JPG
    Shot.JPG
    57.7 KB · Views: 955
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
Hmmm...I'm doing the following and I don't see any changes in the colors of this Label

B4X:
lbl_website.Color = Colors.Cyan
lbl_website.TextColor = Colors.Red

I also tried setting it in the Designer but it didn't take there either. When I ran my app the Label was still White text on a Black background.
 
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
I see. I had to pull the Alpha off of 0 to see the BG color.

Thank you...
 
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
BTW I wasn't able to set the BG color of a label in code because I couldn't set the .Alpha color.

B4X:
lbl_setup_Title.Color = Colors.Cyan
lbl_setup_Title.TextColor = Colors.Red
lbl_setup_Title.Alpha = 114

...third line did not compile...
 
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
Gosh, I would have never figured out that syntax.

B4X:
lbl_setup_Title.TextColor = Colors.Red
lbl_setup_Title.Color = Colors.ARGB(120, 255, 255, 0)

So I'm trying for a Yellow background with Red text via the above code. Unfortunately, it doesn't work as the colors don't change. So I guess I'm still doing something wrong?
 
Upvote 0
Top