textLabel.Text ... stripping spaces from text

Post

Posted
Rating:
#1 (In Topic #216)
Avatar
Enthusiast
GrayGhost is in the usergroup ‘Enthusiast’
Is this a feature or a bug  :D

spaces have been stripped from the text.

Image

(Click to enlarge)

Online now: Yes Back to the top

Post

Posted
Rating:
#2
Avatar
Expert
Quincunxian is in the usergroup ‘Expert’
 The TextLabel control displays text more like a html page and can have embedded (simple) html code such as…
<p>…</p>   <br>   <b>…</b>  <h2>…</h2>

I'd suspect that this is a 'feature' as its really the end result of however the html parser works in Gambas.

I tried this and it will embed 10 X spaces in a string…
  TextLabel1.Text = "test" & String(10, " ") & "test"

The other option is to use a standard label where there is no additional formatting.

Cheers - Quin.
I code therefore I am
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Enthusiast
GrayGhost is in the usergroup ‘Enthusiast’
 thank you for the response and suggestions
now I see what the difference between Label and a Textlabel

I do have a lot to learn … I hope I am not a pest
Online now: Yes Back to the top

Post

Posted
Rating:
#4
Avatar
Regular
stevedee is in the usergroup ‘Regular’

grayghost4 said

 … I hope I am not a pest

We don't allow pests on this forum…only people with a desire to understand what-on-earth is happening to their Gambas code!

Keep 'um coming!


Yes, html is designed to remove any surplus white space (e.g. multiple spaces between characters) although you can still use Tabs in a TextLabel.
Online now: No Back to the top

Post

Posted
Rating:
#5
Regular
didier18 is in the usergroup ‘Regular’
Hello

To make a comparison, there is also this possibility:

Code

Public Sub Form_Open()

  Label1.Caption = "Welcome" & Space(7) & "gambas3"
  TextLabel1.Caption = "Welcome" & "\t" & "gambas3"

End
Have a good day.

Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Enthusiast
GrayGhost is in the usergroup ‘Enthusiast’
 Thanks for the help
The only one I have been able to get to works is :

String(5, " ")

Which at this time is all that I need.
Online now: Yes Back to the top
1 guest and 0 members have just viewed this.