For Programmers: Free Programming Magazines  


Home > Archive > Smartphone Developer Forum > January 2005 > numeric textbox









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author numeric textbox
Harry

2005-01-23, 4:04 pm

How do you force numeric input in a textbox using c#


Daniel Moth

2005-01-23, 4:04 pm

A custom control is the way to go:
http://groups-beta.google.com/group...arch+this+group

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Harry" <obvious@absamail.co.za> wrote in message
news:eR1n%23xVAFHA.3700@tk2msftngp13.phx.gbl...
> How do you force numeric input in a textbox using c#
>
>


riki

2005-01-23, 8:59 pm

Harry wrote:
> How do you force numeric input in a textbox using c#


try:
OpenNETCF.WindowsCE.Forms.InputModeEditor.SetInputMode()

from opennetcf.org. It just sets the input mode to numeric, it doesn't
do any fancy subclassing/overiding.

riki


main(){printf("%d != %d, why?", sizeof('"')["'"],
,(sizeof('"'))["]\"\0["]);}
By Night:
ThemeChanger for Smartphone : http://homepages.inspire.net.nz/~gambit/
AbstractStart for Smartphone :
http://homepages.inspire.net.nz/~gambit/AbstractStart/
By Day: http://www.EmbeddedFusion.com
Harry

2005-01-24, 8:58 am

thanks for the replies
"riki" <see_my_home@page> wrote in message
news:eb2$f1YAFHA.1908@TK2MSFTNGP15.phx.gbl...
> Harry wrote:
>
> try:
> OpenNETCF.WindowsCE.Forms.InputModeEditor.SetInputMode()
>
> from opennetcf.org. It just sets the input mode to numeric, it doesn't
> do any fancy subclassing/overiding.
>
> riki
>
>
> main(){printf("%d != %d, why?", sizeof('"')["'"],
> ,(sizeof('"'))["]\"\0["]);}
> By Night:
> ThemeChanger for Smartphone : http://homepages.inspire.net.nz/~gambit/
> AbstractStart for Smartphone :
> http://homepages.inspire.net.nz/~gambit/AbstractStart/
> By Day: http://www.EmbeddedFusion.com



Douglas Harber

2005-01-24, 4:02 pm

Presumably, this just sets the keypad input more to numeric. Nothing
prevents the user from changing it back to alpha and entering alpha text in
the box.

If you want to allow only numeric input, I think you need to handle that
specially.

Doug Harber

"riki" <see_my_home@page> wrote in message
news:eb2$f1YAFHA.1908@TK2MSFTNGP15.phx.gbl...
> Harry wrote:
>
> try:
> OpenNETCF.WindowsCE.Forms.InputModeEditor.SetInputMode()
>
> from opennetcf.org. It just sets the input mode to numeric, it doesn't do
> any fancy subclassing/overiding.
>
> riki
>
>
> main(){printf("%d != %d, why?", sizeof('"')["'"],
> ,(sizeof('"'))["]\"\0["]);}
> By Night:
> ThemeChanger for Smartphone : http://homepages.inspire.net.nz/~gambit/
> AbstractStart for Smartphone :
> http://homepages.inspire.net.nz/~gambit/AbstractStart/
> By Day: http://www.EmbeddedFusion.com



riki

2005-01-24, 8:58 pm

Douglas Harber wrote:
> Presumably, this just sets the keypad input more to numeric. Nothing
> prevents the user from changing it back to alpha and entering alpha text in
> the box.
>
> If you want to allow only numeric input, I think you need to handle that
> specially.

yes it does stop alpha input (I have a spin control next to my box - so
perhaps it's to blame)

riki

main(){printf("%d != %d, why?", sizeof('"')["'"],
,(sizeof('"'))["]\"\0["]);}
By Night:
ThemeChanger for Smartphone : http://homepages.inspire.net.nz/~gambit/
AbstractStart for Smartphone :
http://homepages.inspire.net.nz/~gambit/AbstractStart/
By Day: http://www.EmbeddedFusion.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com