Hello everyone.
I have two forms in my application, form1 sending a long string (more than 300 characters) or short string (less than 50 characthers) to a label on form2 with a click of a button
Some label properties
Align == alClient
Alignment = taCenter
Layout = tlCenter
WordWrap = True
AutoSize = True
OptimalFill = True
The idea is to adjust the height of the text with OptimalFill, but when I send a long string to the label, the font size, goes all wrong, sometimes the label fills right (when I repeat a long string after a short string for example).
IF I change the Caption, the text height goes bad (still the font size of the first string that I've used), it only changes when I send a small string, things just go strange.
Already tried:
Caption: = ''; // to 'reset' the font size
Legend: = # 0;
Caption: = '';
Caption: = '-'; // to 'delete' and refresh the font height, after it, I assinged the right string
Label.Update; // to update the 'math'
Label.Refresh; // to update the 'math'
Label.AdjustSize
Application.ProcessMessages
Form2.Update
Label.UpdateBaseBound
Labe.AdjustFontForOptimalFill;
I tried after and before the 'on click sent string to'
label.Caption: = stringGrid.Cells [0, stringGrid.Row];
Also tried enable and disable the label to 'reset' everything.
Nothing works right, things have a strange value so the font size depends on the length of the sequence.
How can I make it work right and create the right source calculation each time Legend changes?