有一个BUTTON,点击后出现MonthCalendar,选择日期后MonthCalendar自动消失.这个怎么做?
谢谢大家了
谢谢大家了
解决方案 »
- C# 调用C++接口问题,传递参数为结构体引用,结构体中有返回数据
- 如何在program.cs中加入Timer事件
- c#写的winForm程序中界面上很多控件,应该如何分离Form的代码?
- 数据库恢复问题
- DES加密算法攻略
- XmlValidatingReader 对XSD进行验证,到底是验证什么?
- 请教关于.net安装配置的奇怪问题?急呀!!!!!!!!!!!!!
- 我想在web应用程序中引用dephi写的ActiveX控件,可以吗?
- 高分 !!!求教C S(harp)高手,怎样屏蔽掉输入的不正确的字符? 在线!!
- C#中有无关于SNMP的类,up者有分。
- 请问能否通过winFrom打开一个asp网页,同时转输数据过去!
- pda上启动cab包的问题
using System.Windows.Forms;class Test : Form
{
DateDialog dd = new DateDialog();
Label lbl = new Label(); Test()
{
Button btn = new Button();
btn.Parent = this;
btn.Text = "选择日期";
btn.Top = 30;
btn.Click += new EventHandler(SelectDate); lbl.Parent = this;
lbl.AutoSize = true;
} void SelectDate(object sender, EventArgs e)
{
dd.ShowDialog();
lbl.Text = "您选择的日期是: " + dd.mc.SelectionStart.ToString("yyyy.MM.dd");
} static void Main()
{
Application.Run(new Test());
}
}class DateDialog : Form
{
public MonthCalendar mc; public DateDialog()
{
FormBorderStyle = FormBorderStyle.FixedSingle;
MaximizeBox = false;
MinimizeBox = false;
ShowInTaskbar = false;
Width = 275;
Height = 170; mc = new MonthCalendar();
mc.Parent = this;
mc.DateSelected += new DateRangeEventHandler(DateSelect);
} void DateSelect(object sender, DateRangeEventArgs e)
{
DialogResult = DialogResult.OK;
}
}