Solved

Multiple lines on a button

Posted on 1997-12-15
5
188 Views
Last Modified: 2010-04-04
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?
0
Comment
Question by:ble
  • 3
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
Waldek earned 100 total points
ID: 1353644
You must in CreateParams for button make this line
Params.Style:=Params.Style or ES_MULTILINE;
0
 

Author Comment

by:ble
ID: 1353645
I suppose this is not available in Delphi 1.0? (I forgot to tell that I'm using that version.)
0
 

Author Comment

by:ble
ID: 1353646
I found that it is also in Delphi 1.0, but can you give me an example on how to use this?
0
 
LVL 2

Expert Comment

by:Waldek
ID: 1353647
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
 

Author Comment

by:ble
ID: 1353648
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

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi cmd execution 6 60
creating threads in delphi 1 102
Drag & Drop... Data from one grid to another 2 11
Delphi problems to abort a printjob 9 18
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question