c# 怎样实现点击TextBox弹出日历控件,并在点击日历某时间时赋值给TextBox
展开全部
桌面程序?
先让日历控件monthCalendar1的Visible=false;
添加代码
private void textBox1_Click(object sender, EventArgs e)
{
monthCalendar1.Visible = true;
}
private void monthCalendar1_DateSelected(object sender, DateRangeEventArgs e)
{
textBox1.Text = monthCalendar1.SelectionStart.ToShortDateString();
}
先让日历控件monthCalendar1的Visible=false;
添加代码
private void textBox1_Click(object sender, EventArgs e)
{
monthCalendar1.Visible = true;
}
private void monthCalendar1_DateSelected(object sender, DateRangeEventArgs e)
{
textBox1.Text = monthCalendar1.SelectionStart.ToShortDateString();
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询