Text Label formatting
Posted
#1
(In Topic #959)
Expert

The gambas help gives this:
A rich text is a string using a subset of the HTML format.
The following HMTL markups are allowed:
<p> <br> <a> <font>
<b> <i> <s> <sub> <sup> <small> <tt> <u>
<h1> <h2> <h3> <h4> <h5> <h6>
The <font> markup understands the following attributes: face, color, and size.
What I want to do is change the text font colour.
I had assumed it would be something like this:
Code (gambas)
- TextLable.Text = "Standard Colour <font 'color:red'> Color Red</font>"
Code (gambas)
- TextLable.Text = "Standard Colour <font style='color:red'> Color Red</font>"
Any examples appreciated.
Cheers - Quin.
I code therefore I am
I code therefore I am
Posted
Guru

Normal color <font color=red>and red</font>
Or use CSS style inside one of the supported tags..
Normal color
<p style="color:red">
red paragraph
</p>
Posted
Enthusiast

Code (gambas)
Posted
Guru

But …
Code (gambas)
- TextLabel1.Text = "normal text <font color=red>red text</font>"
Works okay
Posted
Enthusiast

This will get you any color you want :
Code (gambas)
they must be disabled in reverse order, this will NOT work:
Code (gambas)
Posted
Expert

Code (gambas)
- GameText = "Game: <font color=red> " & AV.GameName & "</font>"
- GameText &= " - Player: <font color=yellow> " & AV.PlayerName & "</font>"
- GameText &= " - Mode: <font color=cyan> " & AV.DiffAry[AV.GameMode] & "</font>"
I'm passing the TextLabel by reference and thought that this may have something to do with it but apparently not.
*sigh*
Cheers - Quin.
I code therefore I am
I code therefore I am
1 guest and 0 members have just viewed this.


