|
-
October 29th, 2000, 11:50 PM
#1
Tabbing through controls
I have a form with many TextBox controls. When tabbing through these controls and it gets to the last control, the next tab "wraps" around to the first control. Also shift-tab on the first control wraps to the last control. I want it to stop on the last control when tabbing, and stop on the first control when shift-tabbing. How can I make this work?
Thanks for any suggestions!
Brent Dirks
-
October 30th, 2000, 12:55 AM
#2
Re: Tabbing through controls
One way is to set all controls Tabstops properties to false(so that you can trap the tab key) and implement your own tab functionality, building in your first and last control requirements.
-
October 30th, 2000, 01:26 AM
#3
Re: Tabbing through controls
Or simply disable the tabstops for all controls on the gotfocus of both the first and last controls, and manually control the tab and shift tab events on those two controls, and finally on the lostfocus turn on all the tabstops again.
Dim arrTabStop() as Boolean
private Sub TextBox1_GotFocus()
'Store the TabStop property for each control on the
'form and then set the TabStop property of each
'control to false
ReDim arrTabStop(0 to Controls.Count - 1) as Boolean
for i = 0 to Controls.Count - 1
arrTabStop(i) = Controls(i).TabStop
Controls(i).TabStop = false
next
End Sub
private Sub TextBox1_LostFocus()
'Restore the Tabstop property for each control on the form
for i = 0 to Controls.Count - 1
Controls(i).TabStop = arrTabStop(i)
next
End Sub
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
|