Back to Devexpress

DocumentViewerBase.IsMetric Property

windowsforms-devexpress-dot-documentview-dot-controls-dot-documentviewerbase-f3fa0d68.md

latest2.5 KB
Original Source

DocumentViewerBase.IsMetric Property

Gets or sets a value indicating whether or not to use the metric system for measurements in the print preview.

Namespace : DevExpress.DocumentView.Controls

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
[DXCategory("Printing")]
public bool IsMetric { get; set; }
vb
<DXCategory("Printing")>
Public Property IsMetric As Boolean

Property Value

TypeDescription
Boolean

true , to use the metric system for measurements made in the document’s preview; otherwise, false. The default value is set to the System.Globalization.RegionInfo.CurrentRegion.IsMetric property value.

|

Remarks

Set this property’s value to false to measure units in inches (imperial), and to true to measure in millimeters (metric), when the document is previewed.

Example

This example illustrates how to set the system of measurement exposed by the tooltips in a print preview that is shown when manually resizing a document’s margins.

The following methods toggle the measurement system from imperial to metric and vice versa, by switching the DocumentViewerBase.IsMetric property.

csharp
private void SetMillimeterMeasurement() {
    documentViewer1.IsMetric = true;
}

private void SetInchMeasurement() {
    documentViewer1.IsMetric = false;
}
vb
Private Sub SetMillimeterMeasurement()
    DocumentViewer1.IsMetric = True
End Sub

Private Sub SetInchMeasurement()
    DocumentViewer1.IsMetric = False
End Sub

See Also

DocumentViewerBase Class

DocumentViewerBase Members

DevExpress.DocumentView.Controls Namespace