So i have come up with this
Dim ctrlList As New ArrayList
Dim ctrlListCount As Integer
Dim ctrlCount As Integer
Public Function StartNewProjectForm(ByVal doc As RhinoDoc) As Result
For Each ctrl In GroupBox1.Controls
If ctrl.GetType() = GetType(TextBox) Then
ctrlList.Add(ctrl)
End If
Next ctrl
ctrlListCount = ctrlList.Count()
Return Result.Success
End Function
Private Sub Tab_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If ctrlCount < ctrlListCount Then
If e.KeyCode.Equals(Keys.Tab) Then
ctrlList(ctrlCount).Focus()
ctrlCount = ctrlCount + 1
End If
Else
ctrlCount = 0
End If
End Sub
It works… but it’s backwards in the tab order.
I also thought of another way to do this, but I don’t know how. My other thought is setting the tag on all input boxes to “text” or something like that. Storing all those in an array, and index them everytime you press tab.
Thoughts on this?