Solved

Multiple lines on a button

Posted on 1997-12-15
5
184 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
Comment Utility
You must in CreateParams for button make this line
Params.Style:=Params.Style or ES_MULTILINE;
0
 

Author Comment

by:ble
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now