加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Delphi,标签最大字符

发布时间:2020-12-15 09:39:50 所属栏目:大数据 来源:网络整理
导读:TLabel的最大字符数为255(ShortString),但我还需要更多.我该怎么用? 解决方法 不,没有限制.我只是尝试使用一个1223个字符的字符串作为TLabel的标题,这是有效的.但是,在代码中,字符串文字不能超过255个字符.但这不是问题.做就是了 Label1.Caption := 'This i
TLabel的最大字符数为255(ShortString),但我还需要更多.我该怎么用?

解决方法

不,没有限制.我只是尝试使用一个1223个字符的字符串作为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.';

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读