Results 1 to 4 of 4

Thread: [2005] textbox Focus

Hybrid View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    96

    [2005] textbox Focus

    I want to move the "focus" when user press up down left right.
    I write the following code in keydown event.
    But it can't work. The left and right has no problem, however, up and down can't work.

    VB Code:
    1. Select Case e.KeyCode
    2.             Case Keys.Up
    3.                 If x > 1 Then
    4.                     x -= 1
    5.                 End If
    6.             Case Keys.Down
    7.                 If x < 9 Then
    8.                     x += 1
    9.                 End If
    10.             Case Keys.Right
    11.                 If y < 9 Then
    12.                     y += 1
    13.                 End If
    14.             Case Keys.Left
    15.                 If y > 1 Then
    16.                     y -= 1
    17.                 End If
    18.         End Select
    19. arrtextbox(x, y).Focus()

  2. #2
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    734

    Re: [2005] textbox Focus

    Could i just clear something up. Am i right in assuming that you have a 9x9 grid and you have each 'square' in this grid as a textbox?
    If your problem has been solved then please mark the thread [RESOLVED].
    If i have helped then please Rate my post

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    96

    Re: [2005] textbox Focus

    yes 9X9 = 81

  4. #4
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    734

    Re: [2005] textbox Focus

    Have you tried doing some sort of output when them keys are pressed to check that that section of code is being reached by the program. So jus put a message box in each of the case events that don't appear to be working.
    If your problem has been solved then please mark the thread [RESOLVED].
    If i have helped then please Rate my post

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