Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Input fields ala Long, Double, Float etc.

 
 
Old 06-21-2006   #1 (permalink)
HokutoNoKen


 
 

Input fields ala Long, Double, Float etc.

Hi all,

How do I create a input field in XAML that only excepts input data in the
form of double, long etc? And show it in the following form.

1.000, 10.000 or 1 000, 10 000
0,50
and so on.

Do you have to create this behavior manually or are there control fields
that already work like this? I only seem to find the control 'TextBox'.



My System SpecsSystem Spec
Old 06-21-2006   #2 (permalink)
Drew Marsh


 
 

Re: Input fields ala Long, Double, Float etc.

HokutoNoKen wrote:

> How do I create a input field in XAML that only excepts input data in
> the form of double, long etc? And show it in the following form.
>
> 1.000, 10.000 or 1 000, 10 000
> 0,50
> and so on.
> Do you have to create this behavior manually or are there control
> fields that already work like this? I only seem to find the control
> 'TextBox'.


There is no masked edit control for WPF. You would need to validate input
using the KeyDown event to prevent bad characters from being put in. Then,
as far formatting, you could use string.Format with the correct numeric formatting
string.

HTH,
Drew

___________________________________
Drew Marsh
Chief Software Architect
Mimeo.com, Inc. - http://www.mimeo.com
Microsoft C# / WPF MVP
Weblog - http://blog.hackedbrain.com/


My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Re: Virtual PC 2007 Mouse pointer disappears from input fields in guest OS Virtual PC
Fix for long, long, long deleting and copying of files? Vista General
Chinese Traditional Input using Phonetic Input Vista General
Missing manual recipient input fields? - 2nd Request Vista print fax & scan
Missing manual recipient input fields in send dialog? Vista print fax & scan


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46