delphi滚动标题栏文字  
官方Delphi 学习QQ群: 682628230(三千人)\n
频道

delphi滚动标题栏文字


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码.一次移二个. 特此改正,谢谢指点

推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 0.040870189666748 seconds