To set an OK button's enabled state depending on the validity of all the controls on a form I use "btnOK.Enabled = fValidateForm(Me)".
fValidateForm then uses "For Each myControl in myForm" to read through the form's controls and validate them. This works fine.
I would like to do something similar for all of the controls on a user control, something like "btnOK.Enabled = fValidateUserControl(ucName)".
When I declare fValidateUserControl to recieve a parameter of type UserControl, I get a type mismatch. When I declare it with a parameter type of Object and try to use "For Each myControl In myUserControl" I get a method not available for this object error.
Is it possible to read through all of the controls in a user control?