brokeMyLegBiking
asked on
Can I use an Interface instead of Late Binding?
1)I have two child forms which both have a method with the same name and signature:
Public Sub initialize_validation()
For Each control As Control In util.get_controlTagCol(Me)
controlValidation.Control_ Validating (control, Me.DefInstance, ErrorProvider1, Me.DefInstance.btnAddDisab led, False)
Next
End Sub
2)I would like to call this method from a third, parent form based on a reference passed for one of the two child forms.
3)for example:
if somethingTrue then
frm = childFormOne
else
frm = childFormTwo
end if
frm.initialize_validation( )
4) I can accomplish this with late binding, if I turn off Option Strict. However, I would prefer not to have to use late binding. Does anyone know a better way? Perhaps with an Interface? (I have not used interefaces before, I have only read about them, and don't quite understand how to use them and if they will solve my issue here)
Public Sub initialize_validation()
For Each control As Control In util.get_controlTagCol(Me)
controlValidation.Control_
Next
End Sub
2)I would like to call this method from a third, parent form based on a reference passed for one of the two child forms.
3)for example:
if somethingTrue then
frm = childFormOne
else
frm = childFormTwo
end if
frm.initialize_validation(
4) I can accomplish this with late binding, if I turn off Option Strict. However, I would prefer not to have to use late binding. Does anyone know a better way? Perhaps with an Interface? (I have not used interefaces before, I have only read about them, and don't quite understand how to use them and if they will solve my issue here)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
it worked, it's alive! (evil laugh)
awesome, I've been wondering how to do that for a while. So long ugly case statements and late binding!
thx for your help and the sample. kudos!
awesome, I've been wondering how to do that for a while. So long ugly case statements and late binding!
thx for your help and the sample. kudos!
ASKER
Can a class which impliments an Interface have more methods than are defined in the Interface?