delpro
asked on
How to get text out a TCustomLabel
How can I get the text out a TCustomLabel
if Controls[i] is TCustomLabel then
Text := TCustomLabel(Controls[i]). (Want to get the text);
Is their any way exept to use
if Controls[i] is TLabel then
Text := TCustomLabel(Controls[i]). caption;
if Controls[i] is TCustomLabel then
Text := TCustomLabel(Controls[i]).
Is their any way exept to use
if Controls[i] is TLabel then
Text := TCustomLabel(Controls[i]).
Why you don't want to use ".caption"
Well, if you are masochistic you can use the WM_GETTEXT API message to get the text from the edit control...
Cheers,
Raymond,
Cheers,
Raymond,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi guys
I think Radler is right.
Simonet: Sorry a TCustomLabel has no caption property.
rwilson: WM_GETTEXT works only for windows (TWincontrols). Since TCustomLabel is a TGraphicControl that uses the parent TWinControl to be drawn, WM_GETTEXT will not work to extract the caption from a TCustomLabel.
Regards, ptm.
I think Radler is right.
Simonet: Sorry a TCustomLabel has no caption property.
rwilson: WM_GETTEXT works only for windows (TWincontrols). Since TCustomLabel is a TGraphicControl that uses the parent TWinControl to be drawn, WM_GETTEXT will not work to extract the caption from a TCustomLabel.
Regards, ptm.
ASKER
It is Controls[i].GetTextBuf( Txt, 127 ); and not
Controls[i].GetTextBuffer( Txt, 127 );
Controls[i].GetTextBuffer(
Yours,
Alex