L
levimefford
Alright, I need some help with a (somewhat large) problem. I am
working with a large number of controls on a form. I have made it a
bit easier on myself to deal with them through the naming conventions
and locked/unlocked settings. However, there is still one problem that
I have. The order.
Dim ccontrol As Control
Dim txt As TextBox
Dim i As Integer = 29
For Each ccontrol In Me.Sinclair.Controls
If (TypeOf ccontrol Is TextBox) Then
txt = DirectCast(ccontrol, TextBox)
If txt.ReadOnly = True Then
If InStr(ccontrol.Name.ToString, "uiSinclair")
Then
ccontrol.Text =
xlSinclair.Range(CellRange(i)).Value
i = i - 1
End If
End If
End If
Next ccontrol
Works just fine if the text boxes somehow, miraculously, are in the
correct "control order". But I'm not sure what exactly changes this
"control order" or whatever you would like to call it or how I would
go about manually changing this order so that I can load the data that
I want to into these text boxes. If anyone could give me a little
insight on how the program decides what order to iterate through the
controls.
working with a large number of controls on a form. I have made it a
bit easier on myself to deal with them through the naming conventions
and locked/unlocked settings. However, there is still one problem that
I have. The order.
Dim ccontrol As Control
Dim txt As TextBox
Dim i As Integer = 29
For Each ccontrol In Me.Sinclair.Controls
If (TypeOf ccontrol Is TextBox) Then
txt = DirectCast(ccontrol, TextBox)
If txt.ReadOnly = True Then
If InStr(ccontrol.Name.ToString, "uiSinclair")
Then
ccontrol.Text =
xlSinclair.Range(CellRange(i)).Value
i = i - 1
End If
End If
End If
Next ccontrol
Works just fine if the text boxes somehow, miraculously, are in the
correct "control order". But I'm not sure what exactly changes this
"control order" or whatever you would like to call it or how I would
go about manually changing this order so that I can load the data that
I want to into these text boxes. If anyone could give me a little
insight on how the program decides what order to iterate through the
controls.