Back to Devexpress

MapControl.ShowPrintDialog() Method

windowsforms-devexpress-dot-xtramap-dot-mapcontrol-6b203d24.md

latest2.3 KB
Original Source

MapControl.ShowPrintDialog() Method

Displays the standard Print dialog to print the data displayed in the MapControl.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
public void ShowPrintDialog()
vb
Public Sub ShowPrintDialog

Remarks

The Print dialog allows you to select a printer and its settings, and then start or cancel the print operation.

Example

To print a map, use one of the following methods.

csharp
private void ddbPrint_Click(object sender, EventArgs e) {
    switch (printType) {
        case (PrintType.Preview):
            mapControl.ShowPrintPreview();
            break;
        case (PrintType.RibbonPreview):
            mapControl.ShowRibbonPrintPreview();
            break;
        case (PrintType.Dialog):
            mapControl.ShowPrintDialog();
            break;
    }
}
vb
Private Sub ddbPrint_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ddbPrint.Click
    Select Case printType
        Case (MapControl_PrintingExporting.PrintType.Preview)
            mapControl.ShowPrintPreview()
        Case (MapControl_PrintingExporting.PrintType.RibbonPreview)
            mapControl.ShowRibbonPrintPreview()
        Case (MapControl_PrintingExporting.PrintType.Dialog)
            mapControl.ShowPrintDialog()
    End Select
End Sub

See Also

MapControl Class

MapControl Members

DevExpress.XtraMap Namespace