Delphi,标签最大字符

hs2*_*s2d 4 delphi label

TLabel它的最大字符数为255(ShortString),但我还需要更多.我该怎么用?

And*_*and 11

不,没有限制.我只是尝试使用一个1223个字符的字符串作为a的标题,这TLabel是有效的.但是,在代码中,字符串文字不能超过255个字符.但这不是问题.做就是了

Label1.Caption := 'This is a test. This is a test. This is a test.' + 
  'This is a test. This is a test. This is a test. This is a test.' +
  'This is a test. This is a test. This is a test. This is a test.' +
  'This is a test. This is a test. This is a test. This is a test.' +
  'This is a test. This is a test. This is a test. This is a test.' +
  'This is a test. This is a test. This is a test. This is a test.' +
  'This is a test. This is a test. This is a test. This is a test.';
Run Code Online (Sandbox Code Playgroud)

您可以根据需要制作标题,但是单个字符串文字,源代码中的文本在'和'之间,不能超过255个字符.要构造更长的字符串,请使用字符串连接运算符(+)来连接更短的字符串文字.