From 0a1a5e7a85373b73202b6ca235b1b3fd0abc566b Mon Sep 17 00:00:00 2001 From: Ben N Date: Fri, 2 Jun 2017 11:00:18 -0500 Subject: [PATCH] Open the selected list item when Enter is pressed --- PolicyPlus/LoadedAdmx.Designer.vb | 1 - PolicyPlus/LoadedAdmx.vb | 3 +++ PolicyPlus/LoadedProducts.Designer.vb | 1 - PolicyPlus/LoadedProducts.vb | 6 ++++++ PolicyPlus/LoadedSupportDefinitions.Designer.vb | 1 - PolicyPlus/LoadedSupportDefinitions.vb | 3 +++ 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/PolicyPlus/LoadedAdmx.Designer.vb b/PolicyPlus/LoadedAdmx.Designer.vb index 693427d..7f59293 100644 --- a/PolicyPlus/LoadedAdmx.Designer.vb +++ b/PolicyPlus/LoadedAdmx.Designer.vb @@ -74,7 +74,6 @@ Partial Class LoadedAdmx ' 'LoadedAdmx ' - Me.AcceptButton = Me.ButtonClose Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.ButtonClose diff --git a/PolicyPlus/LoadedAdmx.vb b/PolicyPlus/LoadedAdmx.vb index 65669d5..8d745cd 100644 --- a/PolicyPlus/LoadedAdmx.vb +++ b/PolicyPlus/LoadedAdmx.vb @@ -19,4 +19,7 @@ Private Sub LoadedAdmx_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged ChNamespace.Width = Math.Max(30, LsvAdmx.ClientRectangle.Width - ChFolder.Width - ChFileTitle.Width) End Sub + Private Sub LsvAdmx_KeyDown(sender As Object, e As KeyEventArgs) Handles LsvAdmx.KeyDown + If e.KeyCode = Keys.Enter And LsvAdmx.SelectedItems.Count > 0 Then LsvAdmx_DoubleClick(sender, e) + End Sub End Class \ No newline at end of file diff --git a/PolicyPlus/LoadedProducts.Designer.vb b/PolicyPlus/LoadedProducts.Designer.vb index f918444..c50fe3d 100644 --- a/PolicyPlus/LoadedProducts.Designer.vb +++ b/PolicyPlus/LoadedProducts.Designer.vb @@ -161,7 +161,6 @@ Partial Class LoadedProducts ' 'LoadedProducts ' - Me.AcceptButton = Me.ButtonClose Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.ButtonClose diff --git a/PolicyPlus/LoadedProducts.vb b/PolicyPlus/LoadedProducts.vb index 2e2f414..45cc117 100644 --- a/PolicyPlus/LoadedProducts.vb +++ b/PolicyPlus/LoadedProducts.vb @@ -59,4 +59,10 @@ If lsv.SelectedItems.Count = 0 Then Exit Sub DetailProduct.PresentDialog(sender.SelectedItems(0).Tag) End Sub + Sub ListKeyPressed(sender As Object, e As KeyEventArgs) Handles LsvTopLevelProducts.KeyDown, LsvMajorVersions.KeyDown, LsvMinorVersions.KeyDown + If e.KeyCode = Keys.Enter Then + OpenProductDetails(sender, e) + e.Handled = True + End If + End Sub End Class \ No newline at end of file diff --git a/PolicyPlus/LoadedSupportDefinitions.Designer.vb b/PolicyPlus/LoadedSupportDefinitions.Designer.vb index 03c0f00..9d646e5 100644 --- a/PolicyPlus/LoadedSupportDefinitions.Designer.vb +++ b/PolicyPlus/LoadedSupportDefinitions.Designer.vb @@ -82,7 +82,6 @@ Partial Class LoadedSupportDefinitions ' 'LoadedSupportDefinitions ' - Me.AcceptButton = Me.ButtonClose Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.ButtonClose diff --git a/PolicyPlus/LoadedSupportDefinitions.vb b/PolicyPlus/LoadedSupportDefinitions.vb index 7f609ba..744bdb8 100644 --- a/PolicyPlus/LoadedSupportDefinitions.vb +++ b/PolicyPlus/LoadedSupportDefinitions.vb @@ -24,4 +24,7 @@ ' Only repopulate if the form isn't still setting up If Visible Then UpdateListing() End Sub + Private Sub LsvSupport_KeyDown(sender As Object, e As KeyEventArgs) Handles LsvSupport.KeyDown + If e.KeyCode = Keys.Enter And LsvSupport.SelectedItems.Count > 0 Then LsvSupport_DoubleClick(sender, e) + End Sub End Class \ No newline at end of file