From ad8f6618636787f3f3c19a159e12c381102db3a8 Mon Sep 17 00:00:00 2001 From: ReignOfComputer Date: Thu, 9 Mar 2017 15:32:52 +0800 Subject: [PATCH] Add PanelScroll Value Check (#931) Prevents ArgumentOutOfRangeException. --- PKHeX.WinForms/Util/WinFormsUtil.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PKHeX.WinForms/Util/WinFormsUtil.cs b/PKHeX.WinForms/Util/WinFormsUtil.cs index 72e5818e7..2dd5acbc6 100644 --- a/PKHeX.WinForms/Util/WinFormsUtil.cs +++ b/PKHeX.WinForms/Util/WinFormsUtil.cs @@ -162,6 +162,8 @@ internal static int getIndex(ComboBox cb) public static void PanelScroll(object sender, ScrollEventArgs e) { var p = sender as Panel; + if (e.NewValue < 0) + return; switch (e.ScrollOrientation) { case ScrollOrientation.HorizontalScroll: