Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make a button multiline / with word wrap! 1

Status
Not open for further replies.

Indinfer

Programmer
Sep 24, 2015
2
0
0
US
thread102-508896

In another thread, the question by awarnica (Programmer)(OP)25 Mar 03 10:36 was: How to make a button multiline / with word wrap?

The answer by LEICJDN1 (TechnicalUser)25 Mar 03 11:14 was: Click on the Tbutton, then navigate to the properties tab of the object inspector window. Scroll to the bottom and change the Wordwrap option to true, then resize your tbutton appropriately.

Reply by awarnica (Programmer)(OP)25 Mar 03 11:15 was: TButton does not have a Word Wrap property.

I have more information. In Delphi 10 Seattle, the WordWrap property is located in the Object Inspector when TBUTTON is selected. However, you will NOT find it by typing "wordwrap" in the search box of Object Inspector. And you will also not find it by simply scrolling down in Object Inspector.

You CAN find this wordwrap property by typing "text" in the search box, or by scrolling down and spotting "textsettings". You MUST click the + beside "textsettings" to expand it. And THERE you will find WordWrap.


 
I have made buttons (or rather SpeedButtons!) with multi-line captions. Nothing 'auto' just simply a string containing CR+LF somewhere in the middle. The string, of course must be put in from code, as special characters can not be entered from the object inspector.
with SpeedButton66 do
Caption:=Caption + cr_lf + 'Recording Size';

You probably can write code in order to make an 'automated' placement of the two special characters based on string size, font size and the size of the (speed)button.
 
walker2, your technique has the advantage of more control over results. I like your tip!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top