。 
 len:=36;
  time5:=' '+Time4;
  if Length(Names)<=len then
    begin
      for i:=1 to len-Length(Names) do
        begin
          time5:='  '+time5;
        end;
    end
  else if Length(Names)>len then
    begin
      delete(Names,len-3,Length(Names));
      names:=Names+'..';
      time5:='      '+time5;
    end;
  Result:=Names+Time5;



我想让result:=歌曲名+一定数量的空格+时间,从而使他们在listbox中时间列排列整齐,可是当names中有英文的时候空格数就不对。这是为什么?

解决方案 »

  1.   

    用wideString 能取到一样的。拜托,好像排列长度的整齐和字体,等有密切关系吧?~
      

  2.   

    把DELETE方法删除改为用COPY拷贝就可以了
      

  3.   

    widestring类型的字符无论是字母数字还是汉字都看过一个一个字节。
      

  4.   

    Type          Maximum length Memory required Used forShortString 255 characters 2 to 256 bytes backward compatibilityAnsiString ~2^31 characters 4 bytes to 2GB 8-bit (ANSI) characters, DBCS 
    ANSI, MBCS ANSI, etc.WideString ~2^30 characters 4 bytes to 2GB Unicode characters; multi-user servers and multi-language applications
      

  5.   

    英文一个字节...汉字二个字节...使用WIDESTRING...那都是二个字节.
      

  6.   

    需要使用等宽字体。
    如果方便,请帮我儿子投一票
    http://www.nutricia.com.cn/view.asp?id=736
    谢谢。