如何捕捉点击滚动条发生的事件

slyt 2005-10-29 09:11:19
当我点击CheckListBox的滚动条时,想做一定的处理,该写哪个事件啊,或者如何捕捉到也行
...全文
169 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
alexanda2000 2005-10-30
  • 打赏
  • 举报
回复
不好意思,
procedure NewWndProc(var Msg:TMessage);Message WM_VSCROLL;
这一句的Message WM_VSCROLL应该去掉
slyt 2005-10-29
  • 打赏
  • 举报
回复
xiexie
alexanda2000 2005-10-29
  • 打赏
  • 举报
回复
type
TForm1 = class(TForm)
CheckListBox1: TCheckListBox;
Button1: TButton;
procedure FormCreate(Sender: TObject);
private
OldWndProc:TWndMethod;
procedure NewWndProc(var Msg:TMessage);Message WM_VSCROLL;
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.NewWndProc(var Msg: TMessage);
begin
if Msg.Msg = WM_VSCROLL then ShowMessage('接收到滚动条消息');
if Assigned(OldWndProc) then
OldWndProc(Msg);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
OldWndProc:=CheckListBox1.WindowProc;
CheckListBox1.WindowProc:=NewWndProc;
end;

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧