如何创建Silverlight中的一个数字文本框?文本框、数字、Silverlight

2023-09-03 00:07:10 作者:深情是罪

正如标题所说真的。 我看了一下从文本框继承,但唯一明智的倍率是的onkeydown,但这只是给了我从密钥枚举的关键(没有办法用Char.IsNumeric())。

As the title says really. I've had a look at inheriting from TextBox, but the only sensible override was "OnKeyDown", but that just gives me a key from the Key enum (with no way to use Char.IsNumeric()).

推荐答案

看看的NumericUpDown工具包的http:// codeplex.com / Silverlight的,也许你可以使用或查看源代码来实现自己的数字文本框。

Take a look at NumericUpDown in the Toolkit http://codeplex.com/Silverlight and maybe you can use that or look at the source to implement your own numeric textbox.