Back to Devexpress

ChartOptionsPrint.PrintCrosshair Property

corelibraries-devexpress-dot-xtracharts-dot-printing-dot-chartoptionsprint-15ec473b.md

latest3.2 KB
Original Source

ChartOptionsPrint.PrintCrosshair Property

Gets or sets the value specifying whether to draw the crosshair when printing/exporting the chart.

Namespace : DevExpress.XtraCharts.Printing

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public bool PrintCrosshair { get; set; }
vb
Public Property PrintCrosshair As Boolean

Property Value

TypeDescription
Boolean

true , if the crosshair should be printed/exported with a chart; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to PrintCrosshair
ChartControl

.OptionsPrint .PrintCrosshair

|

Remarks

Refer to the Print and Export help topic for more information on printing/exporting the chart.

Example

This example demonstrates how the Print and Export functionality relies upon the ChartOptionsPrint.PrintCrosshair property. The Ribbon control contains two items: the Show Print Preview button and the Print Crosshair check button. The Chart Control displays the Crosshair Cursor on mouse click. When the check button is checked, the Crosshair Cursor that the Chart Control currently shows will be printed:

csharp
private void OnChartControlMouseUp(object sender, MouseEventArgs e) {
    var diagram = (XYDiagram)chartControl.Diagram;
    diagram.ShowCrosshair(e.Location.X, e.Location.Y);
}

private void OnShowPrintPreviewItemClick(object sender, ItemClickEventArgs e) {
    chartControl.ShowPrintPreview();
}

private void OnPrintCrosshairItemClick(object sender, ItemClickEventArgs e) {
    chartControl.OptionsPrint.PrintCrosshair = bciPrintCrosshair.Checked;
}
vb
Private Sub OnChartControlMouseUp(sender As Object, e As MouseEventArgs)
    var diagram = CType(chartControl.Diagram, XYDiagram)
    diagram.ShowCrosshair(e.Location.X, e.Location.Y)
End Sub

Private Sub OnShowPrintPreviewItemClick(sender As Object, e As ItemClickEventArgs)
    chartControl.ShowPrintPreview()
End Sub

Private Sub OnPrintCrosshairItemClick(sender As Object, e As ItemClickEventArgs)
    chartControl.OptionsPrint.PrintCrosshair = bciPrintCrosshair.Checked
End Sub

See Also

ChartOptionsPrint Class

ChartOptionsPrint Members

DevExpress.XtraCharts.Printing Namespace