diff --git a/ShiftOS.WinForms/Tools/ControlManager.cs b/ShiftOS.WinForms/Tools/ControlManager.cs index 8eba773..1067c3f 100644 --- a/ShiftOS.WinForms/Tools/ControlManager.cs +++ b/ShiftOS.WinForms/Tools/ControlManager.cs @@ -135,19 +135,25 @@ namespace ShiftOS.WinForms.Tools } } + public static void SetCursor(Control ctrl) + { + if (!(ctrl is WebBrowser)) + { + var mouse = SkinEngine.GetImage("mouse"); + if (mouse == null) + mouse = Properties.Resources.DefaultMouse; + + var mBmp = new Bitmap(mouse); + var gfx = Graphics.FromImage(mBmp); + var handle = mBmp.GetHicon(); + + ctrl.Cursor = new Cursor(handle); + } + } public static void SetupControl(Control ctrl) { - - var mouse = SkinEngine.GetImage("mouse"); - if (mouse == null) - mouse = Properties.Resources.DefaultMouse; - - var mBmp = new Bitmap(mouse); - var gfx = Graphics.FromImage(mBmp); - var handle = mBmp.GetHicon(); - - ctrl.Cursor = new Cursor(handle); + SetCursor(ctrl); if (!(ctrl is MenuStrip) && !(ctrl is ToolStrip) && !(ctrl is StatusStrip) && !(ctrl is ContextMenuStrip)) { string tag = ""; diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index c45feee..7f8f232 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -109,6 +109,16 @@ namespace ShiftOS.WinForms time.Start(); this.DoubleBuffered = true; + SetCursors(this); + } + + public void SetCursors(Control ctrl) + { + ControlManager.SetupControl(ctrl); + foreach(Control child in ctrl.Controls) + { + SetCursors(child); + } } /// @@ -178,6 +188,7 @@ namespace ShiftOS.WinForms pnlbtn.Click += onClick; pnlbtntext.Click += onClick; } + SetCursors(pnlbtn); } } }