|
-
Jan 19th, 2003, 04:29 PM
#1
Thread Starter
Sleep mode
moving through textboxes by arrows
hi
how can I move through textboxes using down and up arrows ?
thanx
-
Jan 19th, 2003, 04:56 PM
#2
Thread Starter
Sleep mode
-
Jan 19th, 2003, 05:47 PM
#3
Thread Starter
Sleep mode
OK , What is the ascii code of vbKeyDown then ?
-
Jan 20th, 2003, 02:53 AM
#4
Registered User
Didn't try this but..... its from the KeyUp event args...
Code:
If e.KeyCode = Keys.Up Then
-
Jan 20th, 2003, 12:43 PM
#5
Thread Starter
Sleep mode
no way . aren't all arrow keys have events ? I mean when I press left arrow then something would happen .anyone can help plz ?
-
Jan 20th, 2003, 01:12 PM
#6
PowerPoster
This is how I do it with C#
Code:
private void textBox1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
if(e.KeyCode.ToString() == "Down")
{
// Go to the control down from this one.
textBox2.Focus();
return;
}
if(e.KeyCode.ToString() == "Up")
{
// Go to the control up from this one.
someControlOnTop.Focus();
return;
}
}
-
Jan 20th, 2003, 01:36 PM
#7
Thread Starter
Sleep mode
exactly what I needed . Thanks hellswraith.
-
Jan 21st, 2003, 03:30 AM
#8
Registered User
Just out of curiousity, why do you have to use tostring?
apparently 'If e.KeyCode = Keys.Up Then' didn't work according to Pirate but 'If e.KeyCode.ToString = "Up" Then' did?
I have still not tried this, but this puzzles me.....
-
Jan 21st, 2003, 08:09 AM
#9
Thread Starter
Sleep mode
your way it perfect too Athley. When I was trying that in the KeyPress not in the KeyUp . I am using this anyways:
VB Code:
Private Sub TextBox1_KeyUp........................
If e.KeyCode = Keys.Up Then
TextBox2.Focus()
End If
If e.KeyCode = Keys.Down Then
TextBox3.Focus()
End If
end sub
I think no need to convert that to string Unless C# only accepts that way , I guess no .
-
Jan 21st, 2003, 11:07 AM
#10
Registered User
Aha, well I got a little confused there. Now I can sleep tonight.
-
Jan 21st, 2003, 11:23 AM
#11
Thread Starter
Sleep mode
hehe
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
|