menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class Ruler - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class Ruler

    The Ruler provides a horizontal and vertical guide for measuring the units/positions of elements in the Diagram control.

    Inheritance
    System.Object
    PropertyContainer
    Ruler
    HorizontalRuler
    VerticalRuler
    Implements
    IServiceReferenceHolder
    IServiceReferenceProvider
    IPropertyObserver
    IPropertyContainer
    System.ICloneable
    System.Runtime.Serialization.ISerializable
    System.IDisposable
    Inherited Members
    PropertyContainer.Clone()
    PropertyContainer.Dispose()
    PropertyContainer.FullContainerName
    PropertyContainer.GetPropertyContainerByName(String)
    PropertyContainer.GetPropertyContainerName()
    PropertyContainer.HistoryService
    PropertyContainer.IPropertyObserver.OnPropertyChanged(String, String)
    PropertyContainer.IPropertyObserver.OnPropertyChanging(String, String, Object)
    PropertyContainer.ISerializable.GetObjectData(SerializationInfo, StreamingContext)
    PropertyContainer.m_propertyObserver
    PropertyContainer.OnMeasureUnitsChanging(MeasureUnits, MeasureUnits)
    PropertyContainer.OnPropertyChanged(String)
    PropertyContainer.OnPropertyChanging(String, Object)
    PropertyContainer.PropertyObserber
    PropertyContainer.ProvideServiceReference(RuntimeTypeHandle)
    PropertyContainer.RecordPropertyChanged(String)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Windows.Forms.Diagram
    Assembly: Syncfusion.Diagram.Base.dll
    Syntax
    public abstract class Ruler : PropertyContainer, IServiceReferenceHolder, IServiceReferenceProvider, IPropertyObserver, IPropertyContainer, ICloneable, ISerializable, IDisposable
    Remarks

    The Ruler can be used to measure the Diagram objects, indicate positions, and align Diagram elements. Rulers can be enabled by setting the ShowRulers property for the Diagram control. The rulers will automatically inherit the MeasurementUnit set for the diagram model and get converted accordingly. The height of the ruler can be set through the RulersHeight property.This is especially useful in creating scale models.You can set the unit of measure such as centimeters or inches.The default unit of measure is pixels.

    Constructors

    Ruler()

    Creates instance of Ruler

    Declaration
    public Ruler()

    Ruler(Ruler)

    Creates Ruler as copy given

    Declaration
    public Ruler(Ruler src)
    Parameters
    Type Name Description
    Ruler src

    The source instance.

    Ruler(SerializationInfo, StreamingContext)

    Initializes a new instance of the Ruler class.

    Declaration
    public Ruler(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    The info.

    System.Runtime.Serialization.StreamingContext context

    The context.

    Properties

    BackgroundColor

    Gets or sets the color of the background.

    Declaration
    public Color BackgroundColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    The color of the background.

    BorderColor

    Gets or sets the color of the background.

    Declaration
    public Color BorderColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    The color of the background.

    FontColor

    Gets or sets the color of the scale numbers.

    Declaration
    public Color FontColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    The color of the scale numbers.

    GridSpacingType

    Specify the grid space is updating dynamically based on zooming the diagram.

    Declaration
    public GridSpacingType GridSpacingType { get; set; }
    Property Value
    Type
    GridSpacingType

    HighlightAreaStart

    Gets or sets the highlight area start.

    Declaration
    public int HighlightAreaStart { get; set; }
    Property Value
    Type Description
    System.Int32

    The highlight area start.

    HighlightAreaWidth

    Gets or sets the width of the highlight area.

    Declaration
    public int HighlightAreaWidth { get; set; }
    Property Value
    Type Description
    System.Int32

    The width of the highlight area.

    HighlightColor

    Gets or sets the color of the highlight.

    Declaration
    public Color HighlightColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    The color of the highlight.

    InheritContainerMeasureUnits

    Gets or sets a value indicating whether current instance inherit container measure units.

    Declaration
    public override bool InheritContainerMeasureUnits { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if current instance inherit container measure units; otherwise, false.

    Overrides
    PropertyContainer.InheritContainerMeasureUnits

    Location

    Gets or sets the location.

    Declaration
    public Point Location { get; set; }
    Property Value
    Type Description
    System.Drawing.Point

    The location.

    MajorCalibratedLineUnits

    Gets or sets the major calibrated line unit for ruler

    Declaration
    public float MajorCalibratedLineUnits { get; set; }
    Property Value
    Type
    System.Single

    MajorLinesColor

    Gets or sets the color of the major lines.

    Declaration
    public Color MajorLinesColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    The color of the major lines.

    MarkerColor

    Gets or sets the color of the marker.

    Declaration
    public Color MarkerColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    The color of the marker.

    MarkerPosition

    Gets or sets the marker position.

    Declaration
    public int MarkerPosition { get; set; }
    Property Value
    Type Description
    System.Int32

    The marker position.

    MeasureUnit

    Gets or sets the measure unit.

    Declaration
    public override MeasureUnits MeasureUnit { get; set; }
    Property Value
    Type Description
    MeasureUnits

    The measure unit.

    Overrides
    PropertyContainer.MeasureUnit

    MinimumCalibratedLineUnits

    Gets the minimum calibrated line unit for ruler

    Declaration
    public float MinimumCalibratedLineUnits { get; }
    Property Value
    Type
    System.Single

    MinorLinesColor

    Gets or sets the color of the minor lines.

    Declaration
    public Color MinorLinesColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    The color of the minor lines.

    Size

    Gets or sets the size.

    Declaration
    public Size Size { get; set; }
    Property Value
    Type Description
    System.Drawing.Size

    The size.

    TextStyle

    Gets the text style.

    Declaration
    public FontStyle TextStyle { get; }
    Property Value
    Type Description
    FontStyle

    The text style.

    Methods

    CreateMarkupRenderer(MeasureUnits)

    Create Markup Renderer for Diagram Measure Units

    Declaration
    protected RulerMarkupRenderer CreateMarkupRenderer(MeasureUnits measureUnits)
    Parameters
    Type Name Description
    MeasureUnits measureUnits
    Returns
    Type
    RulerMarkupRenderer

    Draw(Graphics, View)

    Draws the specified graphics.

    Declaration
    public abstract void Draw(Graphics gfx, View view)
    Parameters
    Type Name Description
    System.Drawing.Graphics gfx

    Graphics to draw on.

    View view

    The view.

    Draw(Graphics, View, RulerStyleInfo)

    Declaration
    public abstract void Draw(Graphics gfx, View view, RulerStyleInfo themeStyle)
    Parameters
    Type Name Description
    System.Drawing.Graphics gfx
    View view
    RulerStyleInfo themeStyle

    GetMinimumCalibratedLineUnits(MeasureUnits)

    Gets the minimum calibrated line unit

    Declaration
    protected float GetMinimumCalibratedLineUnits(MeasureUnits measureUnits)
    Parameters
    Type Name Description
    MeasureUnits measureUnits

    Measurement unit

    Returns
    Type Description
    System.Single

    Minimum calibrated line unit

    GetObjectData(SerializationInfo, StreamingContext)

    Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.

    Declaration
    protected override void GetObjectData(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    The System.Runtime.Serialization.SerializationInfo to populate with data.

    System.Runtime.Serialization.StreamingContext context

    The destination (see System.Runtime.Serialization.StreamingContext) for this serialization.

    Overrides
    PropertyContainer.GetObjectData(SerializationInfo, StreamingContext)
    Exceptions
    Type Condition
    System.Security.SecurityException

    The caller does not have the required permission.

    UpdateServiceReferences(IServiceReferenceProvider)

    Updates the service references.

    Declaration
    public override void UpdateServiceReferences(IServiceReferenceProvider provider)
    Parameters
    Type Name Description
    IServiceReferenceProvider provider

    The provider.

    Overrides
    PropertyContainer.UpdateServiceReferences(IServiceReferenceProvider)

    Implements

    IServiceReferenceHolder
    IServiceReferenceProvider
    IPropertyObserver
    IPropertyContainer
    System.ICloneable
    System.Runtime.Serialization.ISerializable
    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved