Ribbon for WinForms | ComponentOne
Elements / Ribbon Items / Numeric Box
In This Topic
    Numeric Box
    In This Topic

    A NumericBox displays a box in which numeric values can be entered. The limits for Numeric Box can be set using the Minimum and Maximum properties.

    The GIF below depicts a NumericBox with minimum and maximum values of 5 and10 respectively.

    Numeric box

    Adding NumericBox at Design-Time

    The Ribbon NumericBox can be added at design-time using the Ribbon Group Floating Toolbar or RibbonGroup Items Collection Editor. Also, you can customize the look of the Ribbon Menu using the Ribbon NumericBox Floating ToolBar or by editing the properties in the Properties Window. For more information about floating toolbars, refer this topic

    This image below shows the floating toolbar of NumericBox.

    Floating toolbar

    Adding NumericBox via Code 

    A NumericBox can also be added to the C1Ribbon control through the code using the RibbonNumericBox class. This is depicted in the code below:

    ' Add Numeric Box ribbon item
    Dim numericBox As RibbonNumericBox = New RibbonNumericBox()
    numericBox.Maximum = 10
    numericBox.Minimum = 5
    numericBox.ToolTip = "Select a number"
    numericBox.Label = "Number Box"
    formatGroup.Items.Add(numericBox)
    
    // Add Numeric Box ribbon item
    RibbonNumericBox numericBox = new RibbonNumericBox();
    numericBox.Maximum = 10;
    numericBox.Minimum = 5;
    numericBox.ToolTip = "Select a number";
    numericBox.Label = "Number Box";
    formatGroup.Items.Add(numericBox);