Page 1 of 1

Back and forward buttons

Posted: Sun Mar 11, 2018 8:58 am
by Hitman
Hi guys,
i need to do this,
"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;"

What is the event for this?
My sample is used for TWebBrowser.

Re: Back and forward buttons

Posted: Sun Mar 11, 2018 9:02 am
by salvadordf
Hi,

Use the TChormium.OnLoadingStateChange event.

The MiniBrowser demo has all that code in the TMiniBrowserFrm.Chromium1LoadingStateChange procedure.

Re: Back and forward buttons

Posted: Sun Mar 11, 2018 9:09 am
by Hitman
salvadordf wrote: Sun Mar 11, 2018 9:02 am Hi,

Use the TChormium.OnLoadingStateChange event.

The MiniBrowser demo has all that code in the TMiniBrowserFrm.Chromium1LoadingStateChange procedure.
It indeed does :D
Thanks a lot!!
very much appreciated.