Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TAdvOfficePager
How to automatically redock the tab if the user clicks the undocked tab's 'Close' button

You’d need to attach an event handler for the closing of the page when it is floating. You can do this from the OnTabUnDock event where you attach an event handler to the floating form OnClose event.

Example:


TForm1 = class(TForm)
public
    { Public declarations }
    procedure CloseHandler(Sender: TObject; var Action: TCloseAction);
end;

procedure TForm1.AdvOfficePager1TabUnDock(Sender: TObject;
  APage: TAdvOfficePage);
begin
  APage.GetFloatingWindow.OnClose := CloseHandler;
end;

procedure TForm1.CloseHandler(Sender: TObject; var Action: TCloseAction);
begin
  // floating form closing here
end;