Question Any Key to open particular form when application run

prasad kulkarni

Well-known member
Joined
Sep 7, 2009
Messages
62
Programming Experience
1-3
Hi,

I my window project (vb.net 2005) , there are 20 forms.
I want to open particular form when Press F2 when my application is running

if any one knows , reply me soon
 
Last edited:
Something like this should work. Make sure the KeyPreview property is set to True
VB.NET:
   Private Sub Form3_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.F2 Then
            Dim frm2 As New Form2
            frm2.Show()
        End If
    End Sub
And Yes, that would need to go in all 19 of the other forms.
 
Back
Top