Setting the Increment Value

The Increment property determines by how much the Value property changes when the Up or Down button is clicked at run time. By default the C1NumericBox control starts with its Increment set to 1 but you can customize this number at design time, in XAML, and in code.

At Design Time

To set the Increment property at run time, complete the following steps:

1.   Click the C1NumericBox control once to select it.

2.   Navigate to the Properties window, and enter a number, for example "20", in the text box next to the Increment property.

This will set the Increment property to the number you chose.

In XAML

For example, to set the Increment property to 20 add Increment="20" to the <c1:C1NumericBox> tag so that it appears similar to the following:

<c1:C1NumericBox Height="21.96" HorizontalAlignment="Right" Margin="0,16,105,0" Name="C1NumericBox1" VerticalAlignment="Top" Width="111.01" Increment="20" />

In Code

For example, to set the Increment property to 20 add the following code to your project:

      Visual Basic

      C#

Run your project and observe:

Click the Up and then the Down button a few times or press the Up and Down arrow keys on the keyboard. Notice that the Value changes in steps of 20. You can still edit the value directly by clicking in the text box and entering a number that falls between that step.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.