To amourz
留下你的qq和mail大家研究研究
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure ListBox1Data(Control: TWinControl; Index: Integer;
var Data: String);
procedure Button1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
TListb1 = class(TListBox)
procedure LBADDString(var msg:TMessage);message LB_ADDSTRING;
procedure LBDeleteString(var msg:TMessage);message LB_DELETESTRING;
procedure LBInsertString(var msg:TMessage);message LB_INSERTSTRING;
end;
var
Form1: TForm1;
Listb1: TListb1;
implementation
{$R *.dfm}
procedure TForm1.ListBox1Data(Control: TWinControl; Index: Integer;
var Data: String);
begin
ShowMessage('aa');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Listb1.Items.Add('3');
end;
{ Listb1 }
procedure TListb1.LBADDString(var msg: TMessage);
begin
inherited;
ShowMessage('Add');
end;
procedure TListb1.LBDeleteString(var msg: TMessage);
begin
inherited;
ShowMessage('Delete');
end;
procedure TListb1.LBInsertString(var msg: TMessage);
begin
inherited;
ShowMessage('Insert');
end;
procedure TForm1.FormShow(Sender: TObject);
begin
Listb1 := TListb1.Create(Self);
Listb1.Parent := Form1;
end;
end.