How to: Hide Controls on Worksheets when Printing
When you print a Microsoft Office Excel document that contains Windows Forms controls, the controls are visible on the printed worksheet. You can hide the controls when printing a worksheet.
Applies to: The information in this topic applies to document-level projects for Excel. For more information, see Features Available by Office Application and Project Type.
|
|
To hide controls when a worksheet is printed
Create or open an Excel project in Visual Studio and verify that Sheet1 is visible in the designer. For information about creating projects, see How to: Create Office Projects in Visual Studio.
From the Common Controls tab of the Toolbox, drag a Button control to a cell on
Sheet1.In the Properties window, set the PrintObject property to False.
Controls on Office Documents
Windows Forms Controls on Office Documents Overview
How to: Add Windows Forms Controls to Office Documents
How to: Resize Controls Within Worksheet Cells