Skip to content

Suggestion: Enable/Disable Back and Forward buttons based on available history #1

Open
@birbilis

Description

@birbilis

quoting from
http://dn.embarcadero.com/article/27726

These buttons are currently disabled and we only want them enabled when appropriate. To do this we will use the TWebBrowser's OnCommandStateChange event. The code should look like this:

procedure TForm1.WebBrowser1CommandStateChange(Sender: TObject;
  Command: Integer; Enable: WordBool);
begin
  case Command of
    CSC_NAVIGATEBACK: btnBack.Enabled := Enable;
    CSC_NAVIGATEFORWARD: btnForward.Enabled := Enable;
  end;
end;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions