Dynamically set Height and Width of a TStaticText lazarus / 31-LCL ---------------------------------------------------------------------- Relativity · 2015-10-06 14:14 I have a TPanel containing a TLabel and a TStatictText. The panel can be resized by the user in run-time and I want the TLabel and TStaticText in it to automatically resize thereupon, in order to fit the instantaneous size of the TPanel. For the Label I do something like: TLabel.Width := Round (TPanel.Width * 0.9); TLabel.Height := Round (TPanel.Height * 0.9); etc. having set TLabel.OptimalFill to True in the object inspector. For the TStaticText I would like to do the same, but it doesn't work: the size on the text remains unchanged and, on the other side, for TStaticText there is no OptimalFill property available to set. I use TStaticText because that inscription has a fixed text and I thought that, when the text is fixed, one should use TStaticText, because maybe it demands less resources. Do you think that I should use TLabel instead ? ---------------------------------------------------------------------- zeljko · 2015-10-06 15:43 TLabel is TGraphicControl, TStaticText is widgetset control (TWinControl) and it has handle which points to widgetset hwnd, so it's obvious that TLabel is "cheaper" control. ---------------------------------------------------------------------- Relativity · 2015-10-08 07:29 Thank you. I have changed those TStaticText inscriptions to TLabel.