Results 1 to 2 of 2

Thread: VB.net vs. vb 6 and keydown

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Location
    Faroe Islands
    Posts
    15

    VB.net vs. vb 6 and keydown

    I have upgraded to .Net but i've got a problem

    I used to use keydown and keycode to jump from one textbox to another using the enter key:

    Private Sub txtdbnr_KeyDown()
    Dim KeyCode As Short
    If KeyCode = 13 Then
    txtdbn.Focus()
    End If
    End Sub

    isn't this possible in .net?

    how can i then do it?

    Snorri

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    In .NET , it can be done in different way , one of them is like this :
    VB Code:
    1. Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles
    2. TextBox1.KeyPress
    3.         If Asc(e.KeyChar()) = 13 Then
    4.             TextBox2.Focus()
    5.         End If
    6. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width