From a96516e7e3ab954e2e68f5b72545f592045aa198 Mon Sep 17 00:00:00 2001 From: Kalbintion Date: Fri, 11 Oct 2019 16:47:45 -0500 Subject: [PATCH] Updated fountain panel scrolls to work 'properly' via hacky solution --- HoHTools/Core/frmFountain.Designer.vb | 1 + HoHTools/Core/frmFountain.vb | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/HoHTools/Core/frmFountain.Designer.vb b/HoHTools/Core/frmFountain.Designer.vb index 04690c5..2f97b8f 100644 --- a/HoHTools/Core/frmFountain.Designer.vb +++ b/HoHTools/Core/frmFountain.Designer.vb @@ -1136,6 +1136,7 @@ Partial Class frmFountain Me.Controls.Add(Me.pnlMain) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.KeyPreview = True Me.MaximizeBox = False Me.MaximumSize = New System.Drawing.Size(708, 467) Me.MinimumSize = New System.Drawing.Size(708, 467) diff --git a/HoHTools/Core/frmFountain.vb b/HoHTools/Core/frmFountain.vb index c0f99ec..17de253 100644 --- a/HoHTools/Core/frmFountain.vb +++ b/HoHTools/Core/frmFountain.vb @@ -112,6 +112,15 @@ Private Sub LabelHover(sender As Object, e As System.EventArgs) Dim lb As Label = CType(sender, Label) lb.Image = My.Resources.Fountain_Btn_Hover + + ' Panel Fix, See Region "Panel Scroll Fix" + If lb.Name.Contains("Debuff") Then + activePanel = pnlNegative + ElseIf lb.Name.Contains("Buff") Then + activePanel = pnlPositive + Else + activePanel = Nothing + End If End Sub Private Sub LabelClick(sender As Object, e As System.EventArgs) @@ -134,6 +143,10 @@ ElseIf lb.Tag = "1" Then lb.Image = My.Resources.Fountain_Btn_Selected End If + + ' Panel Fix, See Region "Panel Scroll Fix" + If activePanel IsNot Nothing And lastActive IsNot Nothing Then lastActive.Focus() + activePanel = Nothing End Sub Private Sub UpdateFortune() @@ -319,4 +332,18 @@ Return True End Function +#Region "PanelScrollFix" + + Private activePanel As Panel = Nothing + Private lastActive As Object = Nothing + + Private Sub frmFountain_MouseWheel(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseWheel + If lastActive Is Nothing Then lastActive = Me.ActiveControl + + If activePanel IsNot Nothing Then + activePanel.Focus() + End If + End Sub +#End Region + End Class \ No newline at end of file