Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Dear All, I would like to focus the datetimepicker control and show up the calender. I can simply do the task but i want to remove the focus from the today date (current date) when the calender pops up.
 

any idea please?
 
Thanks,
Posted 8-Nov-12 5:31am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

All you have to do is set the value of the control to the date that you want it to focus on.
You can't set the value to null because the DateTimePicker simply doesn't allow for that.
  Permalink  
Comments
Abdul Rahman Hamidy at 8-Nov-12 13:00pm
   
Thanks, I have already done with null value, and pop up while focusing the control, I am only concern with the focus of current date as when it show down (shows the calender) you can see by default it select today date, but i don't want it that way, I want it to focus the date i want when exactly it pops up.
Marcus Kramer at 8-Nov-12 13:49pm
   
Just set the value of your DateTimePicker.value property and it will show that one by default when it opens up.
Abdul Rahman Hamidy at 10-Nov-12 0:44am
   
Thanks, I don't want to set the value and neither i want it to focus, I only want to show the calender without focusing on the date. I want it to only pop up. no focus on the day.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 310
1 Sergey Alexandrovich Kryukov 176
2 PhilLenoir 164
3 Richard MacCutchan 160
4 Sharmanuj 156
0 Sergey Alexandrovich Kryukov 6,081
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505


Advertise | Privacy | Mobile
Web04 | 2.8.140814.1 | Last Updated 8 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100