Multiple lines on a button

When I want to use multiple lines on a TLabel object, I can use: Caption := 'Line1'+#13+'Line2'.
If I want to do the same for a TButton object this will not work. It gives a text on one line with an character in the text instead a carriage-return. How do I get two lines of text on a button?
bleAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
WaldekConnect With a Mentor Commented:
You must in CreateParams for button make this line
Params.Style:=Params.Style or ES_MULTILINE;
0
 
bleAuthor Commented:
I suppose this is not available in Delphi 1.0? (I forgot to tell that I'm using that version.)
0
 
bleAuthor Commented:
I found that it is also in Delphi 1.0, but can you give me an example on how to use this?
0
 
WaldekCommented:
Example of descendant of TButton

TLineButton=class(TButton)
 protected
  Procedure CreateParams(var Params:TCreateParams);override;
 public
  ....
end;

procedure TLineButton.CreateParams(var ...);
begin
 inherited CreateParams(Params);
 Params.Style:=Params.Style or BS_MULTILINE;
end;

procedure Register;
.........
after register try this
0
 
bleAuthor Commented:
Thanks, clear example, but... BS_MULTILINE is not available on Delphi 1.0, and ES_MULTILINE as you suggested in your first response doesn't work (is indeed not for TButton but for TEdit).
0
All Courses

From novice to tech pro — start learning today.