Skip to main content

TdxCustomSpreadSheet.OnPageControlNewTabButtonClick Event

Enables you to prevent the control from creating a new worksheet in response to a click on the “Add Sheet” button.

Declaration

property OnPageControlNewTabButtonClick: TdxSpreadSheetPageControlNewTabButtonClickEvent read; write;

Remarks

This event occurs every time a user clicks the “Add Sheet” button on the caption bar. You can assign True to the AHandled parameter within an OnPageControlNewTabButtonClick event handler to forbid a user to create a new worksheet in this manner under certain conditions.

procedure TMyForm.dxSpreadSheet1PageControlNewTabButtonClick(ASpreadSheet: TdxCustomSpreadSheet; var AHandled: Boolean);
begin
  if(ASpreadSheet.SheetCount > 3) then // If there are more than three worksheets in an opened document
  AHandled := True;  // A click on the "Add Sheet" button has no effect
end;

Refer to the TdxSpreadSheetPageControlNewTabButtonClickEvent procedural type description for detailed information on all parameters accessible within an OnPageControlNewTabButtonClick event handler.

See Also