Nevron .NET Vision
Nevron.GraphicsCore Namespace / NTextStyle Class / Offset Property
Example


In This Topic
    Offset Property (NTextStyle)
    In This Topic
    Controls the offset of the text origin point from the text base point.
    Syntax
    'Declaration
     
    
    <System.ComponentModel.CategoryAttribute("Position")>
    <System.ComponentModel.DescriptionAttribute("Controls the offset of the text origin point from the text base point.")>
    Public Property Offset As NPointL
    'Usage
     
    
    Dim instance As NTextStyle
    Dim value As NPointL
     
    instance.Offset = value
     
    value = instance.Offset
    [System.ComponentModel.Category("Position")]
    [System.ComponentModel.Description("Controls the offset of the text origin point from the text base point.")]
    public NPointL Offset {get; set;}
    Remarks
    The base point and the origin point deserve special attention. It is essential to understand their meaning because they work together to determine the final text position on the screen. The base point is specified by the control and cannot be changed. For example when you have a bar serie it will position the base points for the texts at the top of each bar. Another example are the axes which positions the base points at the major axis ticks. The origin point is always specified relative to the base point. The value is given in pixels. The default value is 0.
    Example
    The following example creates a label ten pixels away from the left top corner of the control.
    Dim label As NLabel =  New NLabel() 
    label.Text = "Offset of the origin point 10"
    label.HorizontalMargin = 0
    label.VerticalMargin = 0
    label.TextProps.HorzAlign = HorzAlignNear
    label.TextProps.VertAlign = HorzAlignNear
    label.TextProps.Offset = New NPointL(10, 10)
    NChartControl.Labels.Add(label)
    NLabel label = new NLabel();
    label.Text = "Offset of the origin point 10";
    label.HorizontalMargin = 0;
    label.VerticalMargin = 0;
    label.TextProps.HorzAlign = HorzAlignNear;
    label.TextProps.VertAlign = HorzAlignNear;
    label.TextProps.Offset = new NPointL(10, 10);
    NChartControl.Labels.Add(label);
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also