C++ Builder TLabel sometimes gets Garbled Text

164 views Asked by At

I have a simple form in which I set the text of a TLabel like so:

__fastcall TFacChoiceForm::TFacChoiceForm(TComponent* Owner) : TBaseForm(Owner)
{

    CaptionLabel->Text = "Hello User";
    FacSearchBar->SetFocus();
}

About fifty percent of the time, the text shows up in the TLabel just fine. However, the other fifty percent of the time the TLabel displays random garbled text. I noticed that if I tab through the controls on the form, the text will eventually reset itself. I have checked that even when the text is shown garbled, if I look at the TLabels' text in the debugger it is exactly what I would expect it to be. I'm not sure where to look in order to fix this.

1

There are 1 answers

0
James Hogle On BEST ANSWER

I'm not sure why this solved the issue, but increasing the height of the label prevented the garbled text from appearing.