PC Review


Reply
Thread Tools Rate Thread

DateTimePicker time field carry/borrow - still stymied!

 
 
=?Utf-8?B?UmF5IE1pdGNoZWxs?=
Guest
Posts: n/a
 
      1st May 2007
Hello,

I posted this about a month ago but didn't get any response, so I thought
I'd rephrase it. I have a DateTimePicker set for Up/Down Time format
(HH:mm:ss). The problem is that when I click past 59 seconds the minutes do
not increment, and similarly for minutes affecting hours. Also, similarly
for clicking backwards from 00. I've seen this work in other applications so
it must be simple. I could use a value changed event and change everything
manually but the problem is that I can't tell from within that event which
direction the change was going. If there were separate change events for Up
and Down it would be easy. The only other thing I can think of is to
actually compute the coordinates of where the click occurred and determine
whether Up or Down was clicked based upon that. That seems pretty brutal,
however. Any help would be appreciated.

Thanks,
Ray
 
Reply With Quote
 
 
 
 
Peter Duniho
Guest
Posts: n/a
 
      2nd May 2007
On Tue, 01 May 2007 15:18:02 -0700, Ray Mitchell
<RayMitchell_NOSPAM_@MeanOldTeacher.com> wrote:

> [...] the problem is that I can't tell from within that event which
> direction the change was going. If there were separate change events
> for Up and Down it would be easy. The only other thing I can think of
> is to actually compute the coordinates of where the click occurred and
> determine whether Up or Down was clicked based upon that. That seems
> pretty brutal, however. Any help would be appreciated.


I don't have a good answer. I took a quick look, and my first thought
didn't pan out. That is, I was hoping that the when you show the up/down
control, an actual UpDownBase control would be added as a child control
for the DateTimePicker control. Then you could just override that
control's up and down events to accomplish what you want. Unfortunately,
even when the spinner is showing, the DateTimePicker control doesn't have
any children in its Controls collection.

Maybe there still is actually an UpDownBase control in there somewhere,
and there's a way to get at it that I'm not seeing right away.

One thing I note is that I think that the ValueChanged event is definitely
the wrong place to put this functionality. You *could* store a "previous
value", updated every time the value changes, with which you'd compare the
new value. But if you did that then any time the user changed the value
in the control explicitly by typing a new value in, you'd get the same
behavior you're trying to implement for the spinner. As a user myself, I
would find that sort of thing very annoying. For example, suppose the
control initializes to "May 1, 2007" and I type in "30" where the "1" is.
If all you're doing is watching the value change, then the month would
also change, to "April" when I may well have just wanted to change the day
of the month.

Anyway, I think the right approach is to somehow get at the actual up/down
functionality directly. But I don't know how the DateTimePicker
implements this, nor do I know how to get at it. You might do a little
exploring yourself in that area though, and maybe you'll come up with
something.

Pete
 
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
Carry the field Striker3070 Microsoft Access Getting Started 2 2nd Dec 2009 05:45 PM
carry over field New TO Access Microsoft Access Forms 4 25th Feb 2009 04:12 AM
DateTimePicker rollover & carry =?Utf-8?B?UmF5IE1pdGNoZWxs?= Microsoft C# .NET 0 23rd Apr 2007 09:48 PM
Run Time Error 2486 - Can't Carry out this action at the present time jfranke Microsoft Access Reports 0 14th Apr 2007 02:59 PM
carry over a value in a field to same field in new record =?Utf-8?B?UmljaDg0?= Microsoft Access VBA Modules 3 18th Aug 2005 03:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:59 AM.