Home > Back-end >  How to realize the text wrapping in Delphi button?
How to realize the text wrapping in Delphi button?

Time:09-27

In Delphi, I would like to ask about how to implement the text in different consanguinity word wrap?
I type the words, for example, I want to press the button button, will be output, but because of the string is too long, can't completely output, how to solve this problem?

CodePudding user response:

Where the output? Edit? Memo? The Label? The Form itself? . To clarify oh

CodePudding user response:

BTN. Caption:='XXX' + $d + 'yyy';

CodePudding user response:

Capture the output of the string to add "# 13 line feed
"
 procedure TForm1. Btn1Click (Sender: TObject); 
Var
STR: string;
I, j: Integer;
The begin
STR:='12345678987654321';
J:=8;
I:=Length (STR);
ShowMessage (Copy (STR, 1, j) + # 13 + Copy (STR, j + 1, I));
The end;

Is this meaning?

CodePudding user response:

The simplest way:
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- here are reproduced, provenance forgot -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
TButton and TBitBtn can change the background color,
Let the Caption branch, TBitBtn can, TButton no,
Method is to press Alt + F12 switch to the source of DFM, find BitBtn, that item in the Caption to wrap insert # 13,
Such as' BitBtn1 # 13 'ABC', press Alt + F12 switch back again, you can see 'BitBtn1' and 'ABC' branch,

CodePudding user response:

Four years ago, the original poster?

CodePudding user response:

So old posts can interpret
  • Related