Setting the Increment Value

The Increment property determines by how much the Value property changes when the Up or Down button is pressed 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 Microsoft Expression Blend, in XAML, and in code.

At Design Time

To set the Increment property in Blend or Visual Studio, complete the following steps:

1.   Click the C1NumericBox control once to select it.

2.   Navigate to the Properties tab, 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 x:Name="C1NumericBox1" Increment="20"></c1:C1NumericBox>

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:

Press the Up and then the Down button a few times. Notice that the Value changes in steps of 20. You can still edit the value directly by selecting the text box and entering a number that falls between that step.


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