在窗体上放一个Timer,当需要进行滚动时Timer.Enabled:=true;
procedure TForm1.Timer1OnTimer(..)
var APoint:TPoint;
begin
// 判断当前光标位置是否在区域外
GetCursorPos(APoint);
APoint := Form1.ScreenToClient(APoint);
If not PtInRect(Rect,APoint) then
if APoint.x>Rect.Right then
// 向右移动滚动条
else if Apoint.x<Rect.Left then
// 向左移动滚动条
else if .........end;
procedure TForm1.Timer1OnTimer(..)
var APoint:TPoint;
begin
// 判断当前光标位置是否在区域外
GetCursorPos(APoint);
APoint := Form1.ScreenToClient(APoint);
If not PtInRect(Rect,APoint) then
if APoint.x>Rect.Right then
// 向右移动滚动条
else if Apoint.x<Rect.Left then
// 向左移动滚动条
else if .........end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货