我在我的code进行的DateTimePicker
控制。我已经使用了自定义格式。
I've a DateTimePicker
control in my code. And I have used a custom format.
this.dateTimePickerDate.CustomFormat = "dd/MM/yyyy";
this.dateTimePickerDate.Value = System.DateTime.Now;
现在的要求是把重点放在控制的日期部分。例如,如果该控件显示30/06/2011,在Form_Load后,再 30
从日期部分应选择或光标会后的 0
在 30
。
Now the requirement is to focus on the date part of the control. For example if this control shows 30/06/2011, after the form_load, then 30
from the date part should be selected or the cursor will be after the 0
in 30
.
在此先感谢。
这也许code有助于:
Maybe this code helps:
dateTimePicker1.GotFocus += new EventHandler(dateTimePicker1_GotFocus);
void dateTimePicker1_GotFocus(object sender, EventArgs e)
{
SendKeys.Send("{RIGHT 1}");
}
和对形式的负载将焦点设置的DateTimePicker。
And on form load set focus to datetimepicker.