刚才在坛里下了一个<WinApi函数快速查询工具>看到查询窗口上有一个可以滚动的字串,挺有意思,想做一个但没成功,请大家给看一下吧,谢谢!!! WinApi函数快速查询工具:http://bbs.2ccc.com/topic.asp?topicid=48244 var Form1: TForm1; cx:integer; implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin cx:=cx-3; form1.Canvas.CleanupInstance;//这个用得对不对?我想将上次画的清掉,感觉像是它,因没运行成功,所以我无法验证. form1.Canvas.TextOut(CX,50,'演示滚动演示滚动演示滚动演示滚动'); if cx<=0 then cx:=form1.Width; timer1.Enabled:=false; timer2.Enabled:=true; end;
procedure TForm1.Timer2Timer(Sender: TObject); begin timer2.Enabled:=false; timer1.Enabled:=true; end;
procedure TForm1.FormCreate(Sender: TObject); begin cx:=form1.Width; end;
procedure TForm1.Timer1Timer(Sender: TObject); const s='演示滚动演示滚动演示滚动演示滚动'; var i:Longint; begin cx:=cx-3; if not tt then begin form1.Canvas.Font.Color :=clBtnFace; tt:=true; end; if tt then begin form1.Canvas.Font.Color :=clActiveCaption; tt:=false; end; form1.Canvas.TextOut(CX,50,s); i:=canvas.TextWidth(s); form1.Canvas.TextOut(cx+i+1,50,'); if cx<=0-i then cx:=form1.Width; timer1.Enabled:=false; timer2.Enabled:=true; end;