Locking the Control from Editing

By default the C1NumericBox control's Value property is editable by users at run time. If you want to lock the control from being edited, you can set the IsReadOnly property to True.

At Design Time

To lock the C1NumericBox control from run-time editing 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 check the IsReadOnly check box.

This will set the IsReadOnly property to False.

In XAML

For example, to hide the Up and Down buttons in XAML add IsReadOnly="True" to the <c1:C1NumericBox> tag so that it appears similar to the following:

<c1:C1NumericBox x:Name="C1NumericBox1" IsReadOnly="True"></c1:C1NumericBox>

In Code

For example, to hide the Up and Down buttons add the following code to your project:

      Visual Basic

      C#

Run your project and observe:

The control is locked from editing; notice that the Up and Down buttons are grayed out and inactive.


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