From 81b62dd483e38bb735ce2e8975bd2279ec782c20 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 19 Aug 2020 15:56:48 +0200 Subject: [PATCH] ZooFlow: fix key events --- GUIs.ZooFlow/frmFlowForm.vb | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/GUIs.ZooFlow/frmFlowForm.vb b/GUIs.ZooFlow/frmFlowForm.vb index b04e2715..f1e0407b 100644 --- a/GUIs.ZooFlow/frmFlowForm.vb +++ b/GUIs.ZooFlow/frmFlowForm.vb @@ -43,22 +43,8 @@ Public Class frmFlowForm SetFormLocation() SetFormState(OnFlowFormStateChangedEvent.FlowFormState.Default) - ' === Register Events === - - AddHandler MouseClick, New MouseEventHandler(AddressOf Form_MouseClick) - AddHandler MouseMove, New MouseEventHandler(AddressOf Form_MouseMove) - AddHandler KeyUp, New KeyEventHandler(AddressOf Form_KeyUp) - ' === Register As Event Listener === EventBus.Instance.Register(Me) - - ' === TESTING Actions === - Dim oButton As New Button With { - .Location = New Point(10, 10), - .Size = New Size(10, 10), - .Text = "yes" - } - Controls.Add(oButton) End Sub Private Sub frmFlowForm_Closed(sender As Object, e As EventArgs) Handles Me.Closed @@ -69,7 +55,7 @@ Public Class frmFlowForm End Try End Sub - Private Sub Form_MouseClick(sender As Object, ByVal e As MouseEventArgs) + Private Sub Form_MouseClick(sender As Object, ByVal e As MouseEventArgs) Handles Me.MouseClick If e.Button = MouseButtons.Right Then ContextMenuStrip1.Show(Cursor.Position) Else @@ -81,14 +67,14 @@ Public Class frmFlowForm End Sub - Private Sub Form_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) + Private Sub Form_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Me.MouseMove If e.Button = MouseButtons.Left Then ClassWin32.ReleaseCapture() ClassWin32.SendMessage(Handle, ClassWin32.WM_NCLBUTTONDOWN, ClassWin32.HTCAPTION, 0) End If End Sub - Private Sub Form_KeyUp(ByVal sender As Object, ByVal e As KeyEventArgs) + Private Sub Form_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles Me.KeyDown If e.KeyCode = Keys.Escape Then If ESCHitCount > 0 Then Dim result As DialogResult = MessageBox.Show("Exit Zooflow", "Please Varify", MessageBoxButtons.YesNo)