现在的问题是,如果窗口没有隐藏之前 快捷键能够使用,但是窗口隐藏后,按了快捷键没有反应(好像是接受不到快捷键)
请问怎么解决 //注册热键
RegisterHotKey(Handle,101,HotKeyModifiers.Shift,Keys.G);
protected override void WndProc(ref Message m)
{
const int WM_HOTKEY = 0x0312; if (WM_HOTKEY == m.Msg)
{
if (m.WParam.ToInt32() == 101)
hidWindows();
}
base.WndProc(ref m);
}
//隐藏窗口
public void hidWindows()
{
this.Hide();
this.ShowInTaskbar = false;
} //显示窗口
public void showWindows()
{
this.Visible = true;
this.ShowInTaskbar = true;
}
请问怎么解决 //注册热键
RegisterHotKey(Handle,101,HotKeyModifiers.Shift,Keys.G);
protected override void WndProc(ref Message m)
{
const int WM_HOTKEY = 0x0312; if (WM_HOTKEY == m.Msg)
{
if (m.WParam.ToInt32() == 101)
hidWindows();
}
base.WndProc(ref m);
}
//隐藏窗口
public void hidWindows()
{
this.Hide();
this.ShowInTaskbar = false;
} //显示窗口
public void showWindows()
{
this.Visible = true;
this.ShowInTaskbar = true;
}
//隐藏窗口
public void hidWindows()
{
this.Hide();
this.ShowInTaskbar = false;
} //显示窗口
public void showWindows()
{
this.Visible = true;
this.ShowInTaskbar = true;
}改为hide和Show和设置window.status就可以了问几个问题
请问hide为什么在Page_load中使用没有效果?
{
InitializeComponent();
this.Load += new EventHandler(Form1_Load);
} void Form1_Load(object sender, EventArgs e)
{
throw new NotImplementedException();
}
。。是Form_Load.打错了
但是我在Form_Load中调用HIde()没有效果(不知道是不是窗口没有加载完)
请问Form中有什么事件是加载后运行的
谢谢各位
接着散分
public void hidWindows()
{
this.Hide();
} //显示窗口
public void showWindows()
{
this.Show();
}
是实现按 shift+g 隐藏和显示窗口吗?你这样隐藏是可以,显示的话showWindows()在哪里调用呢? public void showWindows()
{
this.Visible = false;
this.Show();
WindowState = FormWindowState.Normal;
}
这样直接可以弹出窗口了