本文整理自网络,侵删。
procedure TForm1.Button1Click(Sender: TObject);
var
oldtitle :String;
begin
tmr1.Enabled :=not tmr1.Enabled;
if tmr1.Enabled=false then
begin
Application.Title:=oldtitle;
form1.Caption:=oldtitle;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
oldtitle: string;
begin
Self.Caption :='滚动的标题文字';
Application.Title := Self.Caption ;
oldtitle := Self.Caption
end;
procedure TForm1.tmr1Timer(Sender: TObject);
var
temp :string;
begin
temp := Application.Title;
temp := Temp + temp[1] + temp[2];
temp := Copy(temp,3,Length(temp)) ;
Application.Title := temp;
Form1.Caption := temp;
end;
-----------------------------------------------------------------------------------------------
经过 萧志林 指点 上段 代码 在 处理 半角 文字时会 出现 文字移位乱码的情况 应该把 string改成 widestring 或者转成.Unco码.一次移二个. 特此改正,谢谢指点
相关阅读 >>
更多相关阅读请进入《Delphi》频道 >>