z*****n 发帖数: 83 | 1 I want to do something to all textboxes in a form by
the following code (e.g. add 1 to .text)
call mysub(myform)
Private Sub mysub(ByVal myContainer As Object)
Dim myControl As Control
For Each myControl In myContainer.Controls
If TypeOf myControl Is TextBox Then
'do something to mycontrol
ElseIf myControl.HasChildren Then
Call mysub(myControl)
End If
Next
End Sub
now the strange thing is all my numericalupdown controls
are also change | L*********r 发帖数: 92 | 2 You can use spy++ to verify your assumption.
If it is true, you can try use parent of control.
By the way, if you do not implement library, I prefer a simple way to set all
textbox with same prefix name. |
|