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

相关阅读 >>

Delphi列表控件tlistview定位到某一行

Delphi 无边框窗体常见问题

Delphi 安卓蓝牙动态权限

Delphi memo 手动选择txt文本编码并读取

crc32.pas 第二版

Delphi 2010 域名转换ip

Delphi 2009 中的泛型

Delphi编解码js字符串

Delphi 获取网卡信息

Delphi high 返回数组下标的最大值

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...