Search code examples
.netwinformsinterfacecomboboxenumerable

What is an interface that specifies an enumerable Windows control?


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!


Solution

  • ComboBox doesn't implement an interface, but instead inherits from the abstract class ListControl.