//程序做得不大好..中英文混排时会有乱码..楼主凑和着用吧.:) procedure TForm1.Timer1Timer(Sender: TObject); var StrLab:String; StrTempA:String; StrTempB:String; begin StrLab:=StatusBar1.Panels[0].Text; StrTempA:=StrLab[1]; StrTempB:=Copy(StrLab,2,Length(StrLab)-1); StrLab:=StrTempB + StrTempA; StatusBar1.Panels[0].Text:=StrLab; end;
楼上得把string换称widestring中英文混排时就不会有乱码了,理论上如此,我没试验过。
//代码升级了..中英文混排不会出问题了..楼主不要用上面的代码了.. //字符的滚动是消失一个字符就在字符串的后尾后面出现一个新的字符..如果楼主觉得不大好的话可以自已改一改代码..很容易搞定的.:) var StrLab:String; StrTempA:String; StrTempB:String; begin StrLab:=StatusBar1.Panels[0].Text; if (ord(StrLab[1])>=127) then begin StrTempA:=StrLab[1]+StrLab[2]; StrTempB:=Copy(StrLab,3,Length(StrLab)-1); end else begin StrTempA:=StrLab[1]; StrTempB:=Copy(StrLab,2,Length(StrLab)-1); end; StrLab:=StrTempB + StrTempA; StatusBar1.Panels[0].Text:=StrLab; end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
StrLab:String;
StrTempA:String;
StrTempB:String;
begin
StrLab:=StatusBar1.Panels[0].Text;
StrTempA:=StrLab[1];
StrTempB:=Copy(StrLab,2,Length(StrLab)-1);
StrLab:=StrTempB + StrTempA;
StatusBar1.Panels[0].Text:=StrLab;
end;
//字符的滚动是消失一个字符就在字符串的后尾后面出现一个新的字符..如果楼主觉得不大好的话可以自已改一改代码..很容易搞定的.:)
var
StrLab:String;
StrTempA:String;
StrTempB:String;
begin
StrLab:=StatusBar1.Panels[0].Text;
if (ord(StrLab[1])>=127) then
begin
StrTempA:=StrLab[1]+StrLab[2];
StrTempB:=Copy(StrLab,3,Length(StrLab)-1);
end
else
begin
StrTempA:=StrLab[1];
StrTempB:=Copy(StrLab,2,Length(StrLab)-1);
end;
StrLab:=StrTempB + StrTempA;
StatusBar1.Panels[0].Text:=StrLab;
end;
谢谢你的提示`!我试过了..OK`