Label.Text Property

rfresh

Well-Known Member
Licensed User
Longtime User
I'm trying to change the text of a Label but when I change it, part of the text that was there before still remains visible. I have tried to set the .Text = "" but it didn't make any difference. So I end up with what looks like garbage text after trying to edit the .Text property.

Any idea's as to what is causing this?

Thanks...
 
What I discovered is that in the Designer, I had added the text of the label in the .Text property. Then when trying to dynamically change the .Text in code, the original text would remain on the screen while the dynamic code over wrote it but didn't actually remove it!! Strange!

When I removed the .Text string in the Designer, and left it blank, the dynamic code changes to the .Text property displayed cleanly as it should and as one would expect.

I don't understand why having a text string in the Designer label .Text field would mess this up later when changing it programatically, but it did and once I removed it, the code was able to change the text field cleanly.
 
Upvote 0
Where are you calling the LoadLayout? It probably has something to do with this.
 
Upvote 0
Back
Top