I have a method that validates a combo box control like so:
Public Function ValidateComboBox(ByVal objMessageMode As Errors.MessageMode, ByVal cboInput As ComboBox) As Boolean
Dim blnValidated As Boolean
'no value--invalidate'
If cboInput.SelectedValue Is Nothing Then
Errors.InvalidateField(cboInput, Errors.errFieldBlank, Me.ErrorProviderPurchaseTag, objMessageMode)
blnValidated = False
'value--validate'
Else
Errors.ValidateField(cboInput, Me.ErrorProviderPurchaseTag)
blnValidated = True
End If
Return blnValidated
End Function
What I want is to be able to substitute any control as a parameter that implements the behavior of the "SelectedValue" object. Is there an interface that I could specify? Thanks for the help!