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.
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