两个简单的功能怎么实现 1.我的form1是hide(隐藏的)怎么判断当我按f10键它就显示出来?2.我label上面显示的是label1.Text = DateTime.Now.ToString();(就是时间和日期) 那么怎么判断到了整点时候就给个提示? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 to 1你要做个全局hook,来进行捕获按键;to 2你自己判断当前时间,没有简单的方法。 private void Form1_KeyDown(object sender, KeyEventArgs e) //创建一个键盘事件 { if (e.KeyCode == Keys.F10) { if(this.Opacity == 0) this.Opacity = 100; else this.Opacity = 0; } } private void Form1_Load(object sender, EventArgs e) { this.timerNow.Enabled = true; this.timerNow.Start(); } private void timerNow_Tick(object sender, EventArgs e) { this.label1.Text = DateTime.Now.ToString("HH:mm:ss"); if (Convert.ToInt16(DateTime.Now.ToString("mm")) == 0 && Convert.ToInt16(DateTime.Now.ToString("ss")) == 0) //当分钟、秒钟为0时触发 MessageBox.Show("现在时刻北京时间" + DateTime.Now.ToString("HH") + "点整","整点报时",MessageBoxButtons.OK,MessageBoxIcon.Information); } private void Form1_KeyDown(object sender, KeyEventArgs e) //创建一个键盘事件 { if (e.KeyCode == Keys.F10) { if(this.Opacity == 0) this.Opacity = 100; else this.Opacity = 0; } }------------------------------------------上面的代码不行啊~-------------------我是在窗体(form )的 private void button1_Click(object sender, System.EventArgs e) { this.Hide(); }当我按f10(其它键也可以)键的时候窗体就显示出来(this.Show()) 帮忙看看这个数据库的访问类是否有问题? 如何将dataGrid内的数据导入水晶报表里 大家帮我看看这段代码哪里出错了? 谁用过InstallAware Studio Admin 2012 打包时怎么配置数据库文件 如何做出象验证码那样的背景框???? 这样的分级汇总如何做????(C#+Sql server2000) WinForm中如何让Datagrid的某一列不能自动排序 读去xml文件 Spring.net 出错 新手请教,关于安装应用程序的问题 如何将表1中的数据插入数据库中的表2中? C#有动态继承机制吗?
{
if (e.KeyCode == Keys.F10)
{
if(this.Opacity == 0)
this.Opacity = 100;
else
this.Opacity = 0;
}
} private void Form1_Load(object sender, EventArgs e)
{
this.timerNow.Enabled = true;
this.timerNow.Start();
} private void timerNow_Tick(object sender, EventArgs e)
{
this.label1.Text = DateTime.Now.ToString("HH:mm:ss");
if (Convert.ToInt16(DateTime.Now.ToString("mm")) == 0 && Convert.ToInt16(DateTime.Now.ToString("ss")) == 0) //当分钟、秒钟为0时触发
MessageBox.Show("现在时刻北京时间" + DateTime.Now.ToString("HH") + "点整","整点报时",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
{
if (e.KeyCode == Keys.F10)
{
if(this.Opacity == 0)
this.Opacity = 100;
else
this.Opacity = 0;
}
}
------------------------------------------
上面的代码不行啊~
-------------------
我是在窗体(form )的
private void button1_Click(object sender, System.EventArgs e)
{
this.Hide();
}
当我按f10(其它键也可以)键的时候窗体就显示出来(this.Show())