Skip to main content
A newer version of this page is available. .

CommandVisibility Enum

Specifies the visibility levels for the printing system commands.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v19.1.Core.dll

Declaration

public enum CommandVisibility

Members

Name Description
None

Both the command’s toolbar button and menu item are invisible.

Menu

Deprecated; use CommandVisibility All instead. Both the command’s toolbar item and menu item are visible.

Toolbar

Deprecated; use CommandVisibility All instead. Both the command’s toolbar item and menu item are visible.

All

Both the command’s toolbar item and menu item are visible.

Remarks

This enumeration’s members are used to specify the visibility level for the printing system commands via the PrintingSystemBase.SetCommandVisibility method. A list of all the printing system commands is provided by the PrintingSystemCommand enumeration.

Example

This example illustrates how to change the visibility of the toolbar buttons and menu items of a print preview by using the PrintingSystemBase.SetCommandVisibility method that defines the availability of commands in print preview.

The following code hides the Watermark button from the toolbar (together with the corresponding menu item), makes the DocumentMap button and menu item visible, and then makes the ExportToCsv and ExportToTxt commands visible (in both the window’s menu, and in the toolbar).

All available commands are listed in the PrintingSystemCommand enumeration.

using DevExpress.XtraPrinting;
// ...

// Get the printing system of the DocumentViewer control.
PrintingSystemBase ps = documentViewer1.PrintingSystem;

// Hide the Watermark toolbar button, and also the Watermark menu item.
if (ps.GetCommandVisibility(PrintingSystemCommand.Watermark) != CommandVisibility.None){
   ps.SetCommandVisibility(PrintingSystemCommand.Watermark, CommandVisibility.None);
}

// Show the Document Map toolbar button and menu item.
ps.SetCommandVisibility(PrintingSystemCommand.DocumentMap, CommandVisibility.All);

// Make the "Export to Csv" and "Export to Txt" commands visible.
ps.SetCommandVisibility(new PrintingSystemCommand[] 
   {PrintingSystemCommand.ExportCsv, PrintingSystemCommand.ExportTxt}, CommandVisibility.All);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CommandVisibility enum.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also