Windows Develop Bookmark and Share   
 index > Windows Forms General > DateTimePicker focus problem
 

DateTimePicker focus problem

Hi,

I have a DateTimePicker control thatis embedded in aDataGridView.

I would like to programmatically manipulate what part of the DateTime is highlighted. For instance, depending on certain circumstances highlight the month, or sometimes highlight the year.

So far the only solution I have is to use SendKeys, for example:

SendKeys.Send("{RIGHT}");

This work must besubmitted to the head designer, and she is very strict. I would rather not present a SendKeys solution, if anyone can help me do this another way I would appreciate it.

Thank you,
Eric

EisenB  Monday, February 27, 2006 2:17 PM
I am having the same issue (I Think). My issue is that when somone enters a date then goes to the next row, the highlighted field is the last field inside the datetime picker. I want it to be the first field.

If you found a solution, please let me know.

Thanks!
Vinchenzo12  Monday, August 11, 2008 3:40 PM
You can reset the focus with a dirty trick: change the Format.

Dim fmt As DateTimePickerFormat = DateTimePicker1.Format
DateTimePicker1.Format = DateTimePickerFormat.Custom
DateTimePicker1.Format = fmt

nobugz  Tuesday, August 12, 2008 4:50 AM

Ihave same trouble, this solution works thanks

marioramb  Wednesday, August 13, 2008 10:50 PM

You can use google to search for other answers

Custom Search

More Threads

• help needed
• Accessing the DNS suffix?
• mouse hover style in menu or datagridview????
• Screen location
• How to Photo Printing with Fullpage fax print and fullpage photo print programatically?
• Image cannot be added to the ImageList
• button Blinking
• Use a combo box to return text in three text boxes? Visual Studio 2005 and VB
• Detect Computer Restart
• ContextMenuStrip memory problem