aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Tools
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-06-04 15:18:53 -0400
committerMichael <[email protected]>2017-06-04 15:18:53 -0400
commit69aba3b373f9c9c70ec4ef2250e71465d3327299 (patch)
tree5a429b05410d2ea63cfde3c766c103309be45b1c /ShiftOS.WinForms/Tools
parent4faeb54225919bab1692859b4fe9d9b65f3bedea (diff)
downloadshiftos_thereturn-69aba3b373f9c9c70ec4ef2250e71465d3327299.tar.gz
shiftos_thereturn-69aba3b373f9c9c70ec4ef2250e71465d3327299.tar.bz2
shiftos_thereturn-69aba3b373f9c9c70ec4ef2250e71465d3327299.zip
A fuckton of storyline features.
Diffstat (limited to 'ShiftOS.WinForms/Tools')
-rw-r--r--ShiftOS.WinForms/Tools/ControlManager.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/ShiftOS.WinForms/Tools/ControlManager.cs b/ShiftOS.WinForms/Tools/ControlManager.cs
index 548a62a..7fbfd1b 100644
--- a/ShiftOS.WinForms/Tools/ControlManager.cs
+++ b/ShiftOS.WinForms/Tools/ControlManager.cs
@@ -137,10 +137,14 @@ namespace ShiftOS.WinForms.Tools
/// <param name="ctrl">The control to center (this is an extension method - you can call it on a control as though it was a method in that control)</param>
public static void CenterParent(this Control ctrl)
{
- ctrl.Location = new Point(
- (ctrl.Parent.Width - ctrl.Width) / 2,
- (ctrl.Parent.Height - ctrl.Height) / 2
- );
+ try
+ {
+ ctrl.Location = new Point(
+ (ctrl.Parent.Width - ctrl.Width) / 2,
+ (ctrl.Parent.Height - ctrl.Height) / 2
+ );
+ }
+ catch { }
}
public static void SetupControl(Control ctrl)