C#求帮解决个热键问题 本帖最后由 planet5563 于 2010-05-17 23:36:16 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 问题在于:if (this.WindowState != FormWindowState.Minimized) { this.WindowState = FormWindowState.Minimized; this.ShowInTaskbar = false; } else { this.ShowInTaskbar = true; this.WindowState = FormWindowState.Normal; }如果把this.ShowInTaskbar = false;和this.ShowInTaskbar = true; 去掉后按Ctrl+Z就可以得来回显示窗体那如果加上他们,应该如何修改才能实现呢? 直接判读是否ShowInTaskbar不行吗?不用管是不是最小化。 我的目的是,按1次Ctrl+Z隐藏窗体(包括任务栏中的),再按1次就是把他们再显示出来· if (this.ShowInTaskbar) { this.WindowState = FormWindowState.Minimized; this.ShowInTaskba = false; } else { this.ShowInTaskbar = true; this.WindowState = FormWindowState.Normal; } if (this.WindowState != FormWindowState.Minimized) { this.WindowState = FormWindowState.Minimized; this.ShowInTaskbar = false; } else { this.ShowInTaskbar = true; this.WindowState = FormWindowState.Normal; }为什么把this.ShowInTaskbar = false和this.ShowInTaskbar = true去掉,就行了呢!!!只是不能达到把任务栏的也隐藏了!有什么办法解决呢!!! http://topic.csdn.net/u/20091112/20/7d2e42c7-625e-4963-aa1d-70377ce78cbd.html int i = this.Handle.ToInt32(); this.ShowInTaskbar = ! this.ShowInTaskbar; int j = this.Handle.ToInt32(); protected override void WndProc(ref Message m) { const int WM_HOTKEY = 0x0312; if (m.Msg == WM_HOTKEY && m.WParam.ToInt32()==100) { if (this.WindowState == FormWindowState.Minimized) { this.Height = 516; this.Width = 715; this.WindowState = FormWindowState.Normal; this.ShowInTaskbar = true; //this.Visible = true; this.Focus(); //this.notifyIcon1.Visible = false; } else { this.Height = 516; this.Width = 715; this.WindowState = FormWindowState.Minimized; //this.Visible = false; this.ShowInTaskbar = false; //skinEngine1.SkinFile = "WaveColor1.ssk"; //this.notifyIcon1.Visible = true; } } HotKey.RegisterHotKey(Handle, 100, HotKey.KeyModifiers.Ctrl, Keys.B); base.WndProc(ref m); } “ThreadContext”的类型初始值设定项引发异常。 如何让 webbrowser 支持多个IE版本? “灵异事件”求解——“方法或属性调用不明确” 高手给解释一下,如何调用 如何自定义GridView在编辑时候的样式?( c#ASP.NET 如何实现对SQLServer数据库的备份 .Net基础问题 我在用.net连接ACCESS数据库的时候出现这样的警告:是什么原因? 请各位推荐基本C#的好书!!! 一个错误。有关调用实时 (JIT) 调试而不是此对话框的详细信息, C#字符串截取 怎么给一个remoting对象传一个大参数
if (this.WindowState != FormWindowState.Minimized)
{
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
}
else
{
this.ShowInTaskbar = true;
this.WindowState = FormWindowState.Normal; }如果把this.ShowInTaskbar = false;和this.ShowInTaskbar = true; 去掉后按Ctrl+Z就可以得来回显示窗体
那如果加上他们,应该如何修改才能实现呢?
我的目的是,按1次Ctrl+Z隐藏窗体(包括任务栏中的),再按1次就是把他们再显示出来·
{
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskba = false;
}
else
{
this.ShowInTaskbar = true;
this.WindowState = FormWindowState.Normal; }
{
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
}
else
{
this.ShowInTaskbar = true;
this.WindowState = FormWindowState.Normal; }为什么把this.ShowInTaskbar = false和this.ShowInTaskbar = true去掉,就行了呢!!!
只是不能达到把任务栏的也隐藏了!有什么办法解决呢!!!
this.ShowInTaskbar = ! this.ShowInTaskbar;
int j = this.Handle.ToInt32();
{
const int WM_HOTKEY = 0x0312;
if (m.Msg == WM_HOTKEY && m.WParam.ToInt32()==100)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Height = 516;
this.Width = 715;
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
//this.Visible = true;
this.Focus();
//this.notifyIcon1.Visible = false;
}
else
{
this.Height = 516;
this.Width = 715;
this.WindowState = FormWindowState.Minimized; //this.Visible = false;
this.ShowInTaskbar = false; //skinEngine1.SkinFile = "WaveColor1.ssk";
//this.notifyIcon1.Visible = true;
}
}
HotKey.RegisterHotKey(Handle, 100, HotKey.KeyModifiers.Ctrl, Keys.B); base.WndProc(ref m); }