C# 手动触发DateTimePicker ComboBox DropDown事件
时间:2011-01-11 来源:chenjiang
项目中用到ComboBox.DropDown事件,来打开DateTimePicker?
代码如下:
{
dateTimePicker1.Focus();
SendKeys.SendWait("%{DOWN}");
comboBox1.Items.Add(dateTimePicker1.Value.ToString("dd/MM/yyyy"));
comboBox1.SelectedIndex=0;
}
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
comboBox1.Items.Clear();
comboBox1.Items.Add(dateTimePicker1.Value.ToString("dd/MM/yyyy"));
comboBox1.SelectedIndex = 0;
}
相关阅读 更多 +
排行榜 更多 +