Solved

Multiple lines on a button

Posted on 1997-12-15
5
194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month4 days, 22 hours left to enroll

635 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