我想知道是否有一种方式可以通过键盘快捷键而不是点击来最大化我的 Windows 窗体应用程序在系统托盘中吗?
目前我是使用以下代码最小化:
//Minimize to Tray with over-ride for short cut
private void MinimiseToTray(bool shortCutPressed)
{
notifyIcon.BalloonTipTitle = "Minimize to Tray App";
notifyIcon.BalloonTipText = "You have successfully minimized your app.";
if (FormWindowState.Minimized == this.WindowState || shortCutPressed)
{
notifyIcon.Visible = true;
notifyIcon.ShowBalloonTip(500);
this.Hide();
}
else if (FormWindowState.Normal == this.WindowState)
{
notifyIcon.Visible = false;
}
}
因此,我需要一个可以最大化它的键盘快捷键。非常感谢!