Click here to Skip to main content
15,904,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to use Left arrow in DateTimePicker Control to move day > month > year



i It succeeds when I press {/}

I try this , in KeyDown Event

If (e.KeyCode == Keys.Left)
{
SendKeys.Send("{Divide}");
}

But it fails
Posted
Comments
ZurdoDev 3-Dec-14 8:36am    
Fails how? Error message?
Ahmed Dabas 8-Dec-14 6:15am    
I mean , i fail to do what i want

1 solution

Try this


DatePicker have property Format=>Custom and CustomFormat=>dd>mm>yyyy

and Programmatically.


C#
dateTimePicker1.Format = DateTimePickerFormat.Custom;
         dateTimePicker1.CustomFormat = "dd>mm>yyyy";
 
Share this answer
 
Comments
Ahmed Dabas 3-Dec-14 12:07pm    
I want in a datetimepicker control in a c# windows application, with the format dd/MM/yyyy.
I want, when user types dd cursor and focus automatically move to month part and so on month part.
When user typed 4 digit as year cursor and focus return back to day part.
or user use left arrow

Note I make my date timepicker as custom control

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900