Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress If Keys.Enter Then Me.Focus() Form2.Show() End If End Sub
private sub form1_keyup() If e.KeyCode = Keys.Return Then Dim form As New Form form.Text = "Form2" form.Show() End If
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button1.Click Dim form2 As New Form2 form2.Show() End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)