Questions tagged [tlabel]

tlabel is a nonwindowed VCL control that displays non editable text on a form. It is defined in the StdCtrls.pas unit.

33 questions
2
votes
2 answers

Problem with adding graphics to TLabel

I'm trying to create with Delphi a component inherited from TLabel, with some custom graphics added to it on TLabel.Paint. I want the graphics to be on left side of text, so I overrode GetClientRect: function TMyComponent.GetClientRect:…
Harriv
  • 6,029
  • 6
  • 44
  • 76
1
vote
1 answer

Is the behaviour of the tab character in a Delphi TLabel caption defined?

If I put tab characters into a string and then assign the Caption property of a label from the string what do the tab characters do? CR characters cause a return, which is useful for displaying a multi-line caption. Tab characters do seem to…
rossmcm
  • 5,493
  • 10
  • 55
  • 118
1
vote
0 answers

TLayout changed its height depending on the height of TLabel

I have several Labels on my Layout. One of the Labels contains large text. The Label has an AutoSize property, WordWrap. If there is large text in it, it stretches, but Layout does not change the size. How to make Layout also resize depending on…
1
vote
0 answers

Hooking Delphi TReader.OnFindComponentClass

How can one make use of TReader.OnFindComponentClass? TReader creation is hard-coded in TStream.ReadComponent. I do not see a place, where one can hook the event. TStream.ReadComponent is not virtual. And even if it were, if one had to derive…
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
1
vote
4 answers

How to create resize event for TLabel (TGraphicControl)

I'm trying to create TLabel descendant, which will display hint with the whole caption when the text width exceed label width. I've set the EllipsisPosition property to epEndEllipsis and my caption is automatically shorted by an ellipsis at the end.…
user532231
1
vote
1 answer

Top Space TLabel or TStaticText Delphi

I need my Label aligned to Top, but in the very top, in the first top pixel. The property layout is already aligned to Top and I'm still getting this spacing. For some reason, Delphi add an extra spacing. I can't have that.
3rdSenna
  • 344
  • 2
  • 16
1
vote
3 answers

Delete TLabel in Delphi

I currently create a two TLabels and a TEdit dynamically, naming them LblDesc+i, EdtAmount+i and LblUnit+i - Where i is an integer that I iterate up by one each time I add those 3 elements. The data in the elements are just for simulation…
H4rdstyler
  • 71
  • 1
  • 11
1
vote
1 answer

Firemonkey: Shrink text font to fit in TLabel

I am attempting to lower the font size of a TLabel if its text is to large to fit in the confines of the label. I didn't see any properties I could set on the label to achieve this, so I have tried writing my own method. My method works by using…
James Hogle
  • 3,010
  • 3
  • 22
  • 46
0
votes
1 answer

Delphi Game Timer program freezes up after 1.5 to 2 hours and sometimes gives an exception "Canvas does not allow"

I have a simple program, single threaded, with a main form that has the controls, and another form with a bitmap and some TLabels on top of the bitmap that have the score, clock time, penalty time teams, and period. In my main form, I have a TTimer…
Craig
  • 11
  • 2
0
votes
1 answer

Can I refer to components using variables in Delphi?

I have many TLabels, and instead of manually changing their .Captions I'd like to do it in code. Something like lbl[i] instead of manually lbl1 := x; lbl2 := y;
0
votes
0 answers

Firemonkey accelerator key

I'm looking for a way to register the accelerator key other than the standard way, that is when the text with the accelerator key is set to the tLabel. I googled a lot and did not find nothing of the sort. Also, in other question, was suggested to…
user2383818
  • 709
  • 1
  • 8
  • 19
0
votes
2 answers

how to copy all the TLabels parented with a TPanel on delphi to another TPanel?

I have a TPanel on a delphi form, I want to copy all the TLabels parented with this TPanel when i press a button and put them in other panel. Is there a way to do that? Thanks.
alexzm1
  • 563
  • 2
  • 7
  • 14
0
votes
0 answers

What must I set so that the label text will wordwrap respective to the parent panel's width?

I'm using C++ Builder. I have created a panel and set the width of said panel to 350. I am using the following code to create labels. TLabel* tempLabel = new TLabel(this); tempLabel->Parent = Panel6; tempLabel->Caption = temp->Text; tempLabel->Top =…
HappyCoding
  • 641
  • 16
  • 36
0
votes
3 answers

How to keep label smoothly centered in scrollbox?

I use a TMemo in TScrollBox to show some text, and a TLabel on top as a header info. Sometimes memo is wider than scroll box and of course Horizontal scroll bar can be used to scroll left and right to see text in memo. I want to have a label as a…
Mike Torrettinni
  • 1,816
  • 2
  • 17
  • 47
0
votes
1 answer

C++ Builder TLabel sometimes gets Garbled Text

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…
James Hogle
  • 3,010
  • 3
  • 22
  • 46