1. 焦点状态
ActiveControl 和 Focus
ActiveControl = textBox1;
默认光标焦点在文本框textBox1处
textBox1.Focus();
焦点转移到textBox1
2. 日期选择显示在文本框
创建伪 DateTimePicker: TextBox文本框并上DateTimePicker缩小至箭头版。
private void dateTimePicker1_CloseUp(object sender, EventArgs e)
{
textBox1.Text = dateTimePicker1.Value.ToString("yyyy/MM/dd");
}
标签:02,控件,dateTimePicker1,C#,文本框,textBox1
From: https://www.cnblogs.com/oyww-2027/p/18089593