Die Methode, die du zuweist, muss in der Klasse deklariert werden!
Falsch:
Delphi-Quellcode:
type
TForm1 = class(TForm)
WebBrowser1: TWebBrowser;
procedure FormCreate(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure WebBrowser1TitleChange(Sender: TObject;
const Text: WideString);
begin
// Irgendwas ...
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
WebBrowser1.OnTitleChange := WebBrowser1TitleChange;
end;
Richtig:
Delphi-Quellcode:
type
TForm1 = class(TForm)
WebBrowser1: TWebBrowser;
procedure FormCreate(Sender: TObject);
private
procedure WebBrowser1TitleChange(Sender: TObject; const Text: WideString);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WebBrowser1TitleChange(Sender: TObject;
const Text: WideString);
begin
// Irgendwas ...
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
WebBrowser1.OnTitleChange := WebBrowser1TitleChange;
end;