Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

Number Textbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jared - 29 Aug 2006 06:17 GMT
Hi,

I have decided the best way to prevent characters from data entry is to use
numericupdown control.

The only problem is I need way to hide the updown control....wish there was
a property for this.

Anyone now easy way to get rid of updown arrows.

Thanks
Jared
Morten Wennevik - 29 Aug 2006 09:39 GMT
Jared

Simply process the KeyPress event and ignore entries that does not comply  
with Char.IsDigit or Char.IsControl.

> Hi,
>
[quoted text clipped - 10 lines]
> Thanks
> Jared

Signature

Happy Coding!
Morten Wennevik [C# MVP]

Jared - 30 Aug 2006 00:08 GMT
Jared - 30 Aug 2006 03:44 GMT
How do I ignore a keypress...there is no .Supress option and can't assign
null
Jared - 30 Aug 2006 05:04 GMT
handled = true  .. got it

> How do I ignore a keypress...there is no .Supress option and can't assign
> null
Morten Wennevik - 30 Aug 2006 07:00 GMT
If you only test for Char.IsDigit only numbers will be accepted, but then  
backspace would not work, even though delete does.  This is solved by also  
testing for Char.IsControl.

> handled = true  .. got it
>
>> How do I ignore a keypress...there is no .Supress option and can't  
>> assign
>> null

Signature

Happy Coding!
Morten Wennevik [C# MVP]

Claes Bergefall - 30 Aug 2006 16:06 GMT
If you set the ES_NUMBER style (as shown in the code I posted) you don't
need to worry about IsDigit, IsControl or KeyPress

  /claes

If you only test for Char.IsDigit only numbers will be accepted, but then
backspace would not work, even though delete does.  This is solved by also
testing for Char.IsControl.

> handled = true  .. got it
>
[quoted text clipped - 3 lines]
>> assign
>> null

Signature

Happy Coding!
Morten Wennevik [C# MVP]

Claes Bergefall - 29 Aug 2006 15:14 GMT
Why not a numeric textbox instead?
http://groups.google.com/group/microsoft.public.dotnet.languages.vb/msg/7fe39a9f
565c4ded?hl=sv


  /claes

> Hi,
>
[quoted text clipped - 8 lines]
> Thanks
> Jared

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.