我有一个方法可以验证组合框控件,如下所示:
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
我想要的是能够将任何控件替换为实现“SelectedValue”对象行为的参数。有我可以指定的接口吗?谢谢您的帮助!