|
-
Jun 14th, 2006, 10:36 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Key Tab Problem
Hi.
I have a form with 4 textboxes. I want to do validation from text3 to text4.
I've tried to use KeyDown, KeyUp and KeyPress but my problem is that none of them fires with TAB Key !? It passes focus to text4, i don't want that.
Any suggestion, what the API function to hook the keyboard?
Regards
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Jun 14th, 2006, 10:38 AM
#2
Re: Key Tab Problem
Try the Validate event
-
Jun 14th, 2006, 10:49 AM
#3
Thread Starter
Frenzied Member
Re: Key Tab Problem
Unfortunetly there's no validade event in vb 5.
Regards
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Jun 14th, 2006, 11:03 AM
#4
Re: Key Tab Problem
then the lostfocus event perhaps
-
Jun 14th, 2006, 11:09 AM
#5
Thread Starter
Frenzied Member
Re: Key Tab Problem
I've tried it , but when i pressed keyenter on text3 keydown event the lostfocus is fired too.
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Jun 14th, 2006, 11:18 AM
#6
Re: Key Tab Problem
 Originally Posted by Asgorath
Hi.
I have a form with 4 textboxes. I want to do validation from text3 to text4.
I've tried to use KeyDown, KeyUp and KeyPress but my problem is that none
What kind of validation are you looking to do?
-
Jun 14th, 2006, 11:31 AM
#7
Thread Starter
Frenzied Member
Re: Key Tab Problem
When i press the key Enter on Text3 i display a modal form that define a variable and closes itself. I don't want the TAB key to be 'enabled' if the variable is empty.
Anyway GetAsyncKeyState might do the trick.
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Jun 14th, 2006, 11:31 AM
#8
Re: Key Tab Problem
How about doing something like this? Add a timer and set the interval to something low like 10:
VB Code:
Private Sub Text3_LostFocus()
Timer1.Enabled = True
End Sub
Private Sub Text4_GotFocus()
If Timer1.Enabled Then
' Validate It
Debug.Print "Validate: " & Text1.Text
End If
End Sub
Private Sub Timer1_Timer()
Timer1.Enabled = False
End Sub
Avoids the need for API.
-
Jun 14th, 2006, 11:47 AM
#9
Thread Starter
Frenzied Member
Re: Key Tab Problem
Ok, i'd forgotten about the gotfocus event, thanks it working now.
Jorge
"The dark side clouds everything. Impossible to see the future is."
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
|