![up and down arrows history up and down arrows history](http://www.clipartbest.com/cliparts/xcg/LAK/xcgLAKbAi.png)
![up and down arrows history up and down arrows history](https://static.wikia.nocookie.net/thehungergames/images/2/2f/Bow_Arrow.jpg)
This.PreviewKeyDown += control_PreviewKeyDown Hook up text event handlers this.PreviewTextInput += control_PreviewTextInput Var buttons = new ButtonsProperties( this) / and attaches event handlers for the buttons and TextBox
#UP AND DOWN ARROWS HISTORY CODE#
The XAML required to inherit from the TextBox is as follows:Ĭopy Code /// /// Constructor: initializes the TextBox, creates the buttons, It turns out that inheriting from a TextBox actually works very well. I have seen some implementations of TextBox controls that inherited from Control, but that meant that all the normal properties of the TextBox would not be available. In any case, a significant amount of code would be required to implement the functionality of the buttons and the arrow keys. To provide the type of flexibility I would like to see in such a control, it could not be created as a UserControl, or a basic ControlTemplate. I have seen a number of versions of the numeric up/down (spinner) control on the Internet, but most of them have to be customized if the look and feel is to be different from the implementation.
![up and down arrows history up and down arrows history](https://images.slideplayer.com/12/3412650/slides/slide_5.jpg)
I am sure that almost all other WPF developers were equally frustrated with Microsoft when they did not include this as an important control in the new controls in the 2010 release of Visual Studio (only four new controls in Visual Studio 2010). One of the significant items missing from the collection of Microsoft WPF controls is the numeric up/down control.