Delphi-Quellcode:
type
TForm1 = class(TForm)
ListBox1: TListBox;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure MyNotify(Sender: TOBject);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.MyNotify(Sender: TObject);
begin
ShowMessage('Oops, I did it again.');
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
for i := 0 to 99 do
begin
Listbox1.Items.Add(IntToStr(i));
Sleep(10);
Listbox1.Refresh;
if i = 59 then
begin
MyNotify(Listbox1);
break;
end;
end;
end;
Ist eiegntlich kein richtiger Eventhandler, aber es sollte reichen um zu verdeutlichen, was ich meine.