Nevron .NET Vision
Nevron.GraphicsCore Namespace / NFontStyle Class / InitFromFont Method
Example


In This Topic
    InitFromFont Method
    In This Topic
    Initialized the font of the text style from the properties of a GDI+ font object.
    Syntax
    'Declaration
     
    
    Public Sub InitFromFont( _
       ByVal font As System.Drawing.Font _
    ) 
    'Usage
     
    
    Dim instance As NFontStyle
    Dim font As System.Drawing.Font
     
    instance.InitFromFont(font)
    public void InitFromFont( 
       System.Drawing.Font font
    )

    Parameters

    font
    Remarks
    The default is Arial 9, but some objects may modify it. Note that it's more efficient to modify the font by using the other font related properties or the SetFont function.
    Example
    The following example creates a new label and changes the font
    Dim label As NLabel =  New NLabel() 
    label.Text = "Hello world"
    label.HorizontalMargin = 0
    label.VerticalMargin = 0
    label.TextProps.HorzAlign = HorzAlignNear
    label.TextProps.VertAlign = HorzAlignNear
    label.TextProps.Font = New Font("Arial", 22)
    NChartControl.Labels.Add(label)
    NLabel label = new NLabel();
    label.Text = "Hello world";
    label.HorizontalMargin = 0;
    label.VerticalMargin = 0;
    label.TextProps.HorzAlign = HorzAlignNear;
    label.TextProps.VertAlign = HorzAlignNear;
    label.TextProps.Font = new Font("Arial", 22);
    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