DesktopDateTimePicker: How the user can chenge the year?

I read the documentation, go to roadmap to know when this feature have been added, read the release note, read the feature request and I do not know - as a user of the software I created how to change the year.

OK, if I want to set 2022, I kno, takes seconds, but I know. But entering Donald Duck birth date will take linuttes and hundred ck-lics in the left triangle (previous month).

At this moment, I do not know where to search exept here.

1 Like

I have the same problem!

I strongly suggest Einhugur’s DateControl. It’s a much more well cared for piece of software. Emile didn’t mention in his last thread if plugins were acceptable, so I was trying to stay out. But if multiple people are having an issue


I fully endorse Einhugur DateControl and CalendarControl as significantly better replacements to DesktopDateTimePicker.

3 Likes
// Create a DateTime Object and add 2 Months on top of current Date
Var d As DateTime = DateTime.Now.AddInterval(0,2)

// Get DateTime from a DesktopDateTimPicker
Var d As DateTime = myDateTimePicketObject.SelectedDate

// Set Date and Time using a String
Var d As DateTime = DateTime.FromString("1970-01-01 00:00:00")
// and set the DateTime selected on a Picker
myDateTimePicketObject.SelectedDate = d

It’s easy once you get the hang of it :slight_smile:

1 Like

You can type a date into the picker fields.

Sometimes Emile left out important information. From the original post I can guess the talk is about the graphical interface:

so the question is: from that graphical interface, how can someone rapidly select 8/25/1970?

Edit: maybe the answer is to mimic what Apple does:

Are those 2 date pickers working together?

It’s what Einhugur’s DateControl offers too :slight_smile:

1 Like

Yes, that is a much better alternative.

Many times ‘native’ controls are very limited. The ‘native’ control that macOS shows for graphical interface for example.

Yes, I know, it is not clear enough and have typos (I have visal troubles today: glasses and magnifying glasses does not help).

I tried to type in the larde got beweeen the Previous Mounth / Nex t Months buttons, but no nothing

Calendar (Apple, macOS) uses:


Cmd-T to show the small window. I use that when I have to go back in times (more than some years). But this is me and I do not have to do it very often (once only today); usuallly, i have to check the current year (or the previous year).
.

@Tim: for me, ask the question the next time. I say n times a day “I do not understand”, so I understand I can (am) quite confuse sometimes, forget / exclude points (even some important points).

@all: the two Controls is not a solution: the simple view is too small and not easy to use (I used one in another projecr, and I do not liked it). I will ask some user tomorrow if it is possible.

That said, the “graphical intercface is far nicer

Sascha (copy/paste= no error):
The user of your application does not have access to your solution. And I do not talk about monts (yes we can do that with years too), but years: think you want to set your birth date


I also will have another problem: I have a “leaving date” in my interface. I think I have to hide that DesktopDateTimePicker and shos it in a button if the user have to set a leave date. I will come back here if/when the case will be on my “duty of the day“.

To be fully clear, imagine an hotel
 (it just ask the birth date an hotel will not ask): they need the date of the first day and the date of the last day. The later may be unknown at reservation time and must stay clear until the customer gives one.

Sure, just create two DesktopDateTimePickers with and without the graphical display, then add event handlers to both that update the other Picker whenever the date is changed:

Sub DateChanged(value as DateTime) Handles DateChanged
  DateTimePicker2.SelectedDate = value
End Sub

Works like a charm.

It’s my way of saying “Here’s a plugin solution, I fully believe it is a much better solution. But if you don’t want me to recommend plugins anymore, please let me know and I will stop.”

C’est ma façon de dire « Voici un plugin, je suis convaincu qu’il s’agit d’une bien meilleure solution. Mais si vous ne voulez plus que je recommande des plugins, faites-le moi savoir et j’arrĂȘterai ».

Auto translation by DeepL.com

Sorry if I missed something but you can click on the month to get a list of months. And in that month view click on the year to see a list of years.

Is that what you are looking for?


I guess you are using Windows or Linux and the native control is different there.
On a mac the native control is the one I posted earlier and can’t select/click the month/year to change the value.

Yes, I’m on Windows 10. Thank you for the clarification.

This is why I wrote my own date picker. I would also recommend you let the user just type in the date as well.

2 Likes

To elaborate a little, since our clients are mostly in a small portion of the US, we can take some liberties with date entry.

If you enter N or NN, that is this day in the current month and year.

If you enter MMDD, that is this month and day in the current year. (One could query the locale to differentiate month from day.)

If you enter MMDDYY, That is month and date within a 15 year window in the future. 021825 would be 2025. 021840 would be 2040. 021841 would be 1941.

You can enter MMDDYYYY if you need to be precise (for birthdates, etc.)

Most date entry is day of month, which requires only one or two keystrokes.

In fact, in the beginning, 12 years ago, the user can write the date
 and I get all kinds of dates / separators

Then I add 3 PopupMenus (Day / Month / Year and this is what they have today.

But I wanted to see what this DesktopDateTimePickler is, and when I tested GraphicalDisplay and I think that I can use that instead of the PopupMenus (31 days is far below the table (desk)).

And here I am; the screen shot below was done yesterday and need some adjustements (I had visual troubles yesterday).

In another projetc, I used the simplifyed version and it is a nightmare when you aheve to change the day number, then the month number; after some minutes, you go drink a cup of tea (coffee, 
).

I am dubious about the use of this Control.

I will change the code and see how I feel at using it.

BTW: Caritas also exists in Germany, but with a red logo.

Have you considered using AlbertoD’s suggestion of using both the graphical and the non-graphical versions of the picker in tandem? This doesn’t take up much more space than the graphical version alone and it speeds up entry considerably; still you can use the graphical method when you feel like it (like you are only switching to a different day of the same or the next month). You would use a DateChanged event handler in both to synchronize the other’s state.

If you need several instances you could enclose the two variants in a container control that you could place multiple times in a window, just like any built-in control:

It is a solution, but the people who use the software are oldsters (like me) and I do not understand why I have to use two when one is enough.

NB: if you enlarge the small one:

I really dislike this.

When a Clilk in the black dot could change the year


On macOS, the small version do not have the Docus.

Actually it doesn’t change the selected date at all, not the year and neither the day or the month, for that matter. In the graphical picker, if you click on the arrows you switch the view by one month for each click but the selected date stays the same, it merely vanishes from view. You click on the dot to switch back to the month and year the currently selected date is in.

Suppose you wanted to select May 17 (incidentally Norway’s national holiday): We are in February so you need to click three times on the right-facing triangle so you see all the days in May. Still none of these are selected yet as the selected date continues to be the current date. Only when you click on 17 does May 17 become the selected date.

But if you should reconsider and decide you don’t really care about a Norwegian holiday you would click on the dot instead which brings you back to February, with the current date still selected. (But if you had clicked on May 17 the dot would switch to a view showing that date – it always works relative to the currently selected date.)