Title: How to implement Forward/Back/Cancel buttons in TWebbrowser
// Navigate to a URL
procedure TForm1.Button1Click(Sender: TObject);
begin
Webbrowser1.Navigate('www.SwissDelphiCenter.com');
end;
// Catch the events and set a button's Enabled state
procedure TForm1.WebBrowser1CommandStateChange(Sender: TObject;
Command: Integer; Enable: WordBool);
begin
case Command of
CSC_NAVIGATEBACK: ButtonBack.Enabled := Enable;
CSC_NAVIGATEFORWARD: ButtonForward.Enabled := Enable;
CSC_UPDATECOMMANDS: ButtonCancel.Enabled := Enable;
end;
end;
procedure TForm1.ButtonBackClick(Sender: TObject);
begin
WebBrowser1.GoBack
end;
procedure TForm1.ButtonForwardClick(Sender: TObject);
begin
WebBrowser1.GoForward
end;
procedure TForm1.ButtonCancelClick(Sender: TObject);
begin
WebBrowser1.Stop;
end;