views:

9968

answers:

7

I'm looking for a simple NumericUpDown (a.k.a. number spinner) control in WPF. This seems to be another lacking control in WPF. There must be some existing ones out there and I don't like to re-invent the wheel.

A: 

This may help: Numeric Data Entry in WPF

Artur Carvalho
That's just how to prevent non-numerical data from being entered into the text box. I'm looking for an actual control that has up/down arrows on it, or something similar.
chaiguy
+3  A: 

Kevin Moore created a NumericUpDown control in WPF, and put it in his "WPF Bag-o-Tricks"

You can find downloads here: http://j832.com/bagotricks/

He has some interesting stuff in there. I haven't played around with the NumericUpDown personally, but I expect this should give you what you're looking for.

I believe he shows it in his "WPF Bootcamp" video. I originally saw it here, but the streaming video appears to be down.

B2Ben
Not exactly good-looking, but I guess I can manage that myself. :P
chaiguy
This is basically the same as the microsoft example posted above.
Kelly
+2  A: 

Microsoft has a "NumericUpDown Custom Control with Theme and UI Automation Support Sample"

John Myczek
Unfortunately it seems to only support one theme..
AndrewS
A: 

If commercial solutions are ok, you may consider this control set: WPF Elements by Mindscape

It contains such a spin control and alternatively (my personal preference) a spin-decorator, that can decorate various numeric controls (like IntegerTextBox, NumericTextBox, also part of the control set) in XAML like this:

<WpfElements:SpinDecorator>
   <WpfElements:IntegerTextBox Text="{Binding Foo}" />
</WpfElements:SpinDecorator>
Simpzon
A: 

The microsoft WPF NumericUpDownControl is a joke at best. My grandma could do better than that. It's a freakin read only label in a rectangle with two repeat buttons stacked on the right.

+1  A: 

Here is an MIT license project with a dll for a WPF control for what you are describing. It allows for customization of increments, minimum, maximum and value with a similar interface to the slider control.

http://code.google.com/p/phoenix-control-library/

Ferretzor