Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxCustomSpreadSheet.OnPageControlNewTabButtonClick Event

In This Article

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

#Declaration

Delphi
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