unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, AppEvnts;
type
tmylistbox = class(tlistbox)
public
procedure onscroll(var msg:tmessage);message WM_VSCROLL;
end;
TForm1 = class(TForm)
ApplicationEvents1: TApplicationEvents;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
listbox1:tmylistbox;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure tmylistbox.onscroll(var msg:tmessage);
begin
inherited;
//beep;
//add your code here
end;
procedure TForm1.FormCreate(Sender: TObject);
var i:integer;
begin
listbox1 := tmylistbox.Create(self);
listbox1.Parent := form1;
for i:=0 to 1000 do
listbox1.Items.Add(inttostr(i));
end;
end.