Step Interval in WPF Double TextBox
18 Nov 20184 minutes to read
The WPF Double TextBox control allows you to increase or decrease the value by pressing the up and down arrow keys on the keyboard or by scrolling the mouse wheel over the control. The ScrollInterval property specifies the increment or decrement interval. The default value of ScrollInterval is 1.
For example, the ScrollInterval value is set to 4. So, that the WPF Double TextBox control Value increases or decreases by 4 while pressing Up arrow or Down arrow keys and Mouse wheel scrolling up or down.
Change Value on Up, Down Arrow Key
The WPF Double TextBox control allows you to increase or decrease the Value based on the ScrollInterval by pressing the up arrow and down arrow keys on the keyboard.
<syncfusion:DoubleTextBox x:Name="doubleTextBox" Width="150"
Height="25" Value ="10" ScrollInterval="2"/>using Syncfusion.Windows.Shared;
DoubleTextBox doubleTextBox = new DoubleTextBox();
doubleTextBox.Width = 150;
doubleTextBox.Height = 25;
doubleTextBox.Value = 10;
doubleTextBox.ScrollInterval = 2;
Change Value on Mouse Wheel
The WPF Double TextBox allows you to increase or decrease the Value based on the ScrollInterval when scrolling the mouse wheel over the control. This is enabled when the IsScrollingOnCircle property is true. The default value of IsScrollingOnCircle is true.
<syncfusion:DoubleTextBox x:Name="doubleTextBox" Width="150" Height="25" Value="34"
IsScrollingOnCircle="True" ScrollInterval="3"/>using Syncfusion.Windows.Shared;
DoubleTextBox doubleTextBox = new DoubleTextBox();
doubleTextBox.Width = 150;
doubleTextBox.Height = 25;
doubleTextBox.Value = 34;
doubleTextBox.IsScrollingOnCircle = true;
doubleTextBox.ScrollInterval = 3;
Change Value on Click and Drag
The WPF Double TextBox allows you to increase or decrease the value based on the ScrollInterval by clicking and dragging the mouse when the EnableExtendedScrolling property is true. The WPF Double TextBox increases when you click and drag the mouse to the right or top of the screen, and decreases when the mouse moves to the left or bottom of the screen. Before that, the control should be in an unfocused state. The default value of EnableExtendedScrolling is false.
<syncfusion:DoubleTextBox x:Name="doubleTextBox" Width="120" Height="25" Value="10"
ScrollInterval="5" EnableExtendedScrolling="True"/>using Syncfusion.Windows.Shared;
DoubleTextBox doubleTextBox = new DoubleTextBox();
doubleTextBox.Width = 120;
doubleTextBox.Height = 25;
doubleTextBox.Value = 10;
doubleTextBox.ScrollInterval = 5;
doubleTextBox.EnableExtendedScrolling = true;
Allow or restrict selection on focus
WPF Double TextBox allows you to automatically select the text when the control receives focus, by setting the TextSelectionOnFocus property to true. If you want to restrict selection when the control receives focus, set TextSelectionOnFocus to false. The default value of TextSelectionOnFocus is true.
<syncfusion:DoubleTextBox x:Name="doubleTextBox" TextSelectionOnFocus="False"/>using Syncfusion.Windows.Shared;
DoubleTextBox doubleTextBox = new DoubleTextBox();
doubleTextBox.TextSelectionOnFocus = false;TextSelectionOnFocus = “False”

TextSelectionOnFocus = “True”
