procedure TForm1.Button1Click(Sender: TObject);
var
 w1:widestring;
begin
  w1:='我是';
  label1.Caption:=w1;
end;d5显示正常
d7显示??

解决方案 »

  1.   

    为什么喜欢用widestring,string不是更好用吗
      

  2.   

    caption 的类型是tcaption =string
    但delphi为了跨平台
    在 CLX 下 tcaption是unicode 即widestring
    在d7里为了统一可能都定义为widestring
    而widestring和string的计算字符串长度方法不同
    所以会出现上述问题
      

  3.   

    陈亮
    现在过得如何
    怎么又遇到这个widestring的问题了
    希望你混得比在莱易好
      

  4.   

    读取xml文件用widestring
    delphi de help tell me delphi can convert string and widestring automaticly but i test through only under delphi5 not delphi7
    but why?
      

  5.   

    Delphi 6 没有这种情况   s : WideString ;
      t : String ;  s := '我的' ;
      t := '我的' ;
      ShowMessage(s) ;
      ShowMessage(t) ;结果正常