|
-
Feb 10th, 2000, 06:26 AM
#1
Thread Starter
Hyperactive Member
For some reason I cannot get VB to register when the Tab key is pressed. Any idea why?
------------------
Ryan
-
Feb 10th, 2000, 06:48 AM
#2
It should. Are you checking for vbKeyTab (=9)?
------------------
Marty
What did the fish say when it hit the concrete wall?
> > > > > "Dam!"
-
Feb 10th, 2000, 07:00 AM
#3
Thread Starter
Hyperactive Member
yes, I am, but see the thing is, it's not even going into the KeyDown event code. So it's not even getting to the
If KeyCode = vbKeyTab Then
statement. And I can't figure out why.
------------------
Ryan
[This message has been edited by Gimpster (edited 02-10-2000).]
-
Feb 10th, 2000, 07:05 AM
#4
PowerPoster
That should work. Are you sure you put this code in KeyDown / KeyUp and not KeyPress?
------------------
[email protected]
...
Every program can be reduced to one instruction which doesn't work.
-
Feb 10th, 2000, 07:14 AM
#5
Thread Starter
Hyperactive Member
yes, I'm sure. I mean it's very baffling, because I have a break point set at the very first line of the KeyDown event and VB doesn't even go into the event code. It never even looks there. It just goes on and inserts the tab and that's it. It doesn't check any code whatsoever. I don't understand it.
------------------
Ryan
-
Feb 10th, 2000, 08:40 AM
#6
Do you have code in the LostFocus event? If so that will fire first.
------------------
Marty
What did the fish say when it hit the concrete wall?
> > > > > "Dam!"
-
Feb 10th, 2000, 08:53 AM
#7
Thread Starter
Hyperactive Member
Yes, I do. The code I have in the LostFocus event re-enables all the tabstops on the other objects. That's the only thing it does, but would that cause problems?
------------------
Ryan
-
Feb 10th, 2000, 09:33 AM
#8
Apparently it does. I created a small app with two textboxes and 1 command button. I set Text2.TabStop = False and in Text1.LostFocus I set Text2.TabStop = True. I also set a breakpoint in Text1.KeyDown. When I ran the program and tabbed out of Text1, the KeyDown event never happened.
------------------
Marty
What did the fish say when it hit the concrete wall?
> > > > > "Dam!"
-
Feb 10th, 2000, 10:56 AM
#9
Hyperactive Member
I would say that the problem is deeper!
TAB is (i think) sending a system message to change the focus to the next control, and thiat is happening even befor the form is envoking any events (including controls events)
-
Feb 11th, 2000, 09:41 AM
#10
New Member
Hey!! Whats going on...
You may want to try setting the KeyPreview property of you FORM to true, and put the check for the TAB key in the KEY DOWN event of the form.
I had a similar problem trying to get DELETE and BACKSPACE to work together. this did the trick!
Hope it helps!
~Sam
-
Feb 11th, 2000, 09:49 AM
#11
Hyperactive Member
Gimpster ;
Vb is slow at getting keydowns events ,
when u press tab over a form or any control
give it some time ... press it for a while
2 to 5 seconds ... i had the same problem when holding a shift key over a button ,
i have to hold the shift key over the button for a while for vb to notice this ...
try it , i think it will work ...
------------------
- regards -
- razzaj -
-
Feb 14th, 2000, 06:15 AM
#12
Thread Starter
Hyperactive Member
Ok, thank you for all the suggestions. And, Rassaj, do you know if there is any way to make VB recognize the keydown quicker?
------------------
Ryan
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
|