2014年8月27日 星期三

vb.net 輸入, 離開 & 回桌面

輸入按 [ Enter ]結束 >>

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If e.KeyChar = Chr(13) Then
            e.Handled = True
            .....
            .....
            TextBox2.Focus()
        End If
    End Sub


回桌面  >>

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Application.Exit()
    End Sub


離開  >>

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()
    End Sub

開form >>

Form2.Show()

沒有留言:

張貼留言