Recent

Author Topic: new line in a textfield  (Read 18230 times)

Anonymous

  • Guest
new line in a textfield
« on: January 22, 2006, 01:58:59 pm »
hi,
i want to add a new line in a textfield. soething like that:

this is the text in  //new line
the text  //new line
field.

whats the code for the formatting??

matthijs

  • Hero Member
  • *****
  • Posts: 537
RE: new line in a textfield
« Reply #1 on: January 22, 2006, 02:57:46 pm »
What kind of text field are you referring to? In which OS do you want to do this?
The following works on a linux box:
Code: [Select]

procedure TForm1.Button2Click(Sender: TObject);
begin
  TButton(Sender).Caption := 'This text and'#10'this text on a new'#10'line';
end;

Under windows you would have to add #13 as well.
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

Drewski

  • Jr. Member
  • **
  • Posts: 55
RE: new line in a textfield
« Reply #2 on: January 22, 2006, 06:27:12 pm »
also
Code: [Select]

procedure TForm1.Button2Click(Sender: TObject);
begin
  TButton(Sender).Caption := 'This text and'+LineEnding+'this text on a new'+LineEnding+'line';
end;


would work crossplatform.

HTH

Andrew

Anonymous

  • Guest
new line in a textfield
« Reply #3 on: February 15, 2006, 07:41:31 pm »
Ok, it works ... but why the text isn't centered on the SpeedButton (he is aligned left and outside the Button) like in Delphi?

(http://home.arcor.de/multimeter/temp/Lazarus.png) (http://home.arcor.de/multimeter/temp/Delphi.png)

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2673
new line in a textfield
« Reply #4 on: February 21, 2006, 09:52:45 am »
This looks like a bug, report it is the bugtracker so we can look at it.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018