PC Review


Reply
Thread Tools Rate Thread

Validating Numericupdown control

 
 
=?Utf-8?B?QmVuIFRheWxvcg==?=
Guest
Posts: n/a
 
      10th Jun 2005
I'm trying to create an app in VB.NET to run on CE/PocketPC. I've got a form
where it asks you for the date and time, auto-populating it with the current
date and time. The date and time shouldn't need to be changed by very much,
so I want to use a control that allows you to change the date and time by a
day or minute by using up/down arrows. The obvious solution to this was the
NumericUpDown control, which does exactly this (numbers rather than dates, so
I used several).

Unfortunately, the NumericUpDown isn't restricted to numeric data - the user
can type letters into it. On top of that, so far all my attempts to validate
it have failed. The Keypress and Keydown events don't seem to get fired so
you can't cancel the keypress, the Validating event doesn't pass the old and
new values of the control, so you can't reset it if the value is invalid and
there's no way to cancel the update. I tried writing my own date/time up-down
control, but when I try to incorporate it into my CE app the app won't
compile - I don't get any compile errors, it just runs through and then
fails. I'm assuming that's because it's a user control and the .NET compact
framework doesn't like it, although since all it is is a text box and scroll
bar with a bit of validation code behind it I really don't know why - I'm
don't think I used anything incompatible with the compact framework.

So, anyway, I was hoping someone had some suggestions as to how to either
validate the NumericUpDown, stop non-numeric entry to it (or any text entry
even, as long as it still allows selection using the up and down buttons) or
else get my user control working.

TIA
Ben
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Numericupdown control bug Steve Microsoft VB .NET 2 12th Jun 2007 02:53 AM
NumericUpDown Control =?Utf-8?B?b3dlbm1q?= Microsoft ASP .NET 1 30th May 2006 12:39 PM
NumericUpDown Control S Shulman Microsoft VB .NET 2 29th Jan 2006 11:31 PM
NumericUpDown control Davor Microsoft VB .NET 0 23rd Aug 2005 08:51 AM
NumericUpDown Control bug Gudia Microsoft Dot NET Framework Forms 0 24th Nov 2003 05:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:22 PM.