diff options
| author | Michael <[email protected]> | 2017-02-04 14:19:45 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-02-04 14:19:45 -0500 |
| commit | 9a37e472fb4e85a1838e06c03eb1632557a6f13c (patch) | |
| tree | 13b1562e1c4cad9e6af389d7b554865c5f16d289 /ShiftOS.WinForms/Tools | |
| parent | 9a9ec274d32b78291c9ca489a0cc7ce45e85907e (diff) | |
| download | shiftos_thereturn-9a37e472fb4e85a1838e06c03eb1632557a6f13c.tar.gz shiftos_thereturn-9a37e472fb4e85a1838e06c03eb1632557a6f13c.tar.bz2 shiftos_thereturn-9a37e472fb4e85a1838e06c03eb1632557a6f13c.zip | |
Fix shiftnet crash with custom cursors
Diffstat (limited to 'ShiftOS.WinForms/Tools')
| -rw-r--r-- | ShiftOS.WinForms/Tools/ControlManager.cs | 24 |
1 files changed, 15 insertions, 9 deletions
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 SetupControl(Control ctrl) + public static void SetCursor(Control ctrl) { + if (!(ctrl is WebBrowser)) + { + var mouse = SkinEngine.GetImage("mouse"); + if (mouse == null) + mouse = Properties.Resources.DefaultMouse; - 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(); - var mBmp = new Bitmap(mouse); - var gfx = Graphics.FromImage(mBmp); - var handle = mBmp.GetHicon(); + ctrl.Cursor = new Cursor(handle); + } + } - ctrl.Cursor = new Cursor(handle); + public static void SetupControl(Control ctrl) + { + SetCursor(ctrl); if (!(ctrl is MenuStrip) && !(ctrl is ToolStrip) && !(ctrl is StatusStrip) && !(ctrl is ContextMenuStrip)) { string tag = ""; |
