ComponentOne Input Library for WPF
Input Library Overview / NumericBox / Work with NumericBox / Setting the Font Type and Size
In This Topic
    Setting the Font Type and Size
    In This Topic

    You can change the appearance of the text in the grid by using the text properties in the C1NumericBox Properties window, through XAML, or through code.

    To change the font of the control to Arial 10pt in XAML add FontFamily="Arial" FontSize="10" to the <c1:C1NumericBox> tag so that it appears similar to the following:

    XAML
    Copy Code
    <c1:C1NumericBox Name="C1NumericBox1" FontFamily="Arial" FontSize="10" />
    

     

    To change the font of the grid to Arial 10pt add the following code to your project:

    Visual Basic
    Copy Code
    C1NumericBox1.FontSize = 10
    C1NumericBox1.FontFamily = New System.Windows.Media.FontFamily("Arial")
    

     

    C#
    Copy Code
    c1NumericBox1.FontSize = 10;
    c1NumericBox1.FontFamily = new System.Windows.Media.FontFamily("Arial");
    

    To change the font of the grid to Arial 10pt in the Properties window at design time, complete the following:

    1. Click the C1NumericBox control once to select it.
    2. Navigate to the Properties window, and set FontFamily property to "Arial".
    3. In the Properties window, set the FontSize property to 10.

    This will set the control's font size and style.

    Run your project and observe:

    The control's content will appear in Arial 10pt font: