473,386 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DateTimePicker time field carry/borrow - still stymied!

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
May 1 '07 #1
1 1911
On Tue, 01 May 2007 15:18:02 -0700, Ray Mitchell
<Ra*****************@MeanOldTeacher.comwrote:
[...] 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
May 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
4
by: Gary Miller | last post by:
Using the custom format "ddd MMMM d h:mm tt". DataBindings.Text is set to my dataset field. Control displays properly, I am able to change date values but the moment I click the save button,...
4
by: Jacek Jurkowski | last post by:
.... the minimum date of DateTimePicker is 1753-01-01. How to make DateTime to do not show nothing in its text if this date is the value? I have a form with a field LastLogonDate. If user hasn't...
3
by: Darin | last post by:
Is there a way to, at runtime, change a textbox to be a datetimepicker? I have a form that I allow the user to specify what field types the input boxes are. They can be regular text, integer,...
2
by: Chris Fairman | last post by:
NG, Maybe I'm missing a key step, but it seems when typing dates into a DateTimePicker control (format = 'Short'), the controls' .text property is not updated until the control losses focus. ...
2
by: =?Utf-8?B?QW5pcnVkZGhh?= | last post by:
Hi, I am building a windows application using VisualStudio 2005(VB.NET). I am using a System.Windows.Forms.DateTimePicker field. By default system date is shown in that field. How can I show...
0
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a DateTimePicker set to the custom format HH:mm:ss. (I used the custom format to avoid the AM/PM part, even though my OS is set up for the 12-hour time format.) It works fine...
4
by: jehugaleahsa | last post by:
Hello: We were hoping to allow users to have DateTimePicker value null so that a unused date is stored on a Database. Does the control support this? I am pretty sure it doesn't. How would you...
11
by: jessy | last post by:
Hi, I have a problem with my DateTimePicker javascript code which i downloaded , the problem is when i pick the date and the date appears in my Text Field and i click Submit the date which i picked...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.