1. train of thought. Add "\ r \ n" to the string to indicate a line break. You can determine the number of rows based on the total length of the string and several characters in each line.
. Yes newline tooltip
Corresponding mainCodeAs follows:
Gettooltiptext
1 Private String Gettooltiptext ( String Originaltext, Int Countperline)
2 {
3 Int Modeint;
4 String Tempstr = String . Empty;
5 Int Tooltiptextlength = Originaltext. length;
6 Float Linef = ( Float ) Tooltiptextlength / Countperline;
7 Double Line = Math. Ceiling (linef );
8
9 If (Tooltiptextlength > Countperline)
10 {
11 For ( Int I = 0 ; I < Line; I ++ )
12 {
13 Modeint = Tooltiptextlength - I * Countperline;
14 If (Modeint < Countperline)
15 {
16 Tempstr + = Originaltext. substring (I * Countperline, modeint );
17 }
18 Else
19 {
20 Tempstr + = Originaltext. substring (I * Countperline, countperline );
21 Tempstr + = " \ R \ n " ;
22 }
23 }
24 }
25 Else
26 {
27 Tempstr = Originaltext;
28 }
29 Return Tempstr;
30 }