By default the C1NumericBox control's C1NumericBox.Value property is editable by users at run time. If you want to lock the control from being edited, you can set the C1NumericBox.IsReadOnly property to True.
At Design Time
To lock the C1NumericBox control from run-time editing, complete the following steps:
This will set the C1NumericBox.IsReadOnly property to False.
In XAML
To lock the C1NumericBox control from run-time editing in XAML add IsReadOnly="True" to the <Xaml:C1NumericBox> tag so that it appears similar to the following:
Markup |
Copy Code
|
---|---|
<Xaml:C1NumericBox x:Name="C1NumericBox1" IsReadOnly="True"></Xaml:C1NumericBox> |
In Code
To lock the C1NumericBox control from run-time editing add the following code to your project:
Visual Basic |
Copy Code
|
---|---|
C1NumericBox1.IsReadOnly = True
|
C# |
Copy Code
|
---|---|
c1NumericBox1.IsReadOnly = true;
|
Run your project and observe:
The control is locked from editing; notice that the Up and Down buttons are grayed out and inactive.