|
-
Jan 24th, 2007, 04:40 AM
#1
Thread Starter
Lively Member
[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:
Select Case e.KeyCode
Case Keys.Up
If x > 1 Then
x -= 1
End If
Case Keys.Down
If x < 9 Then
x += 1
End If
Case Keys.Right
If y < 9 Then
y += 1
End If
Case Keys.Left
If y > 1 Then
y -= 1
End If
End Select
arrtextbox(x, y).Focus()
-
Jan 24th, 2007, 05:34 AM
#2
Fanatic Member
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 
-
Jan 24th, 2007, 07:13 AM
#3
Thread Starter
Lively Member
-
Jan 24th, 2007, 09:06 AM
#4
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|