* Demo增加全局热键

This commit is contained in:
Sunny 2022-01-19 10:33:20 +08:00
parent fca53eefd7
commit ae2356da67
3 changed files with 14 additions and 1 deletions

Binary file not shown.

View File

@ -52,6 +52,9 @@
this.Aside.LineColor = System.Drawing.Color.Black;
this.Aside.Location = new System.Drawing.Point(2, 145);
this.Aside.MenuStyle = Sunny.UI.UIMenuStyle.Black;
this.Aside.ScrollBarColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.Aside.ScrollBarHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.Aside.ScrollBarPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.Aside.ShowOneNode = true;
this.Aside.ShowSecondBackColor = true;
this.Aside.ShowTips = true;
@ -147,11 +150,11 @@
this.Name = "FMain";
this.Padding = new System.Windows.Forms.Padding(2, 35, 2, 2);
this.ShowDragStretch = true;
this.ShowIcon = true;
this.ShowRadius = false;
this.ShowShadow = true;
this.Text = "SunnyUI.Net";
this.Selecting += new Sunny.UI.UIMainFrame.OnSelecting(this.FMain_Selecting);
this.HotKeyEventHandler += new Sunny.UI.HotKeyEventHandler(this.FMain_HotKeyEventHandler);
this.Controls.SetChildIndex(this.Header, 0);
this.Controls.SetChildIndex(this.Aside, 0);
this.Header.ResumeLayout(false);

View File

@ -87,6 +87,8 @@ namespace Sunny.UI.Demo
Aside.SelectPage(1002);
Text = Version + " Build " + Properties.Resources.BuildDate;
RegisterHotKey(UI.ModifierKeys.Shift, Keys.F8);
}
private void Header_MenuItemClick(string text, int menuIndex, int pageIndex)
@ -121,5 +123,13 @@ namespace Sunny.UI.Demo
{
System.Diagnostics.Process.Start("https://gitee.com/yhuse/SunnyUI");
}
private void FMain_HotKeyEventHandler(object sender, HotKeyEventArgs e)
{
if (e.hotKey.ModifierKey == UI.ModifierKeys.Shift && e.hotKey.Key == Keys.F8)
{
ShowInfoTip("您按下了全局系统热键 Shift+F8");
}
}
}
}