Solved

Multiple lines on a button

Posted on 1997-12-15
5
190 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 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