It would look something like this...this is not tested, I just typed it in here. This code would go in your business object...so you would more than likely want to create a subclass of BusinessLayer so you only have to write this code once:Private _RequiredProvider As ErrorProvider
Public Sub ShowRequiredFields()
'-- Establish Locals
Dim loItem As MicroFour.StrataFrame.Business.IRequiredField
Dim loControl As Control
_RequiredProvider = New ErrorProvider(CType(Me.ParentContainer, ContainerControl))
_RequiredProvider.Icon = YourIconFile
' Place any addition provider settings
'-- Cycle through the required fields
For Each loItem In Me.RequiredFields
'-- Get the control
loControl = GetBoundControl(loItem.FieldName)
If loControl IsNot Nothing Then
_RequiredProvider.SetError(GetBoundControl(loItem.FieldName), "Required Field")
End If
Next
End Sub
Private Function GetBoundControl(ByVal FieldName As String) As Control
'-- Establish Locals
Dim loControl As Control = Nothing
Dim loItem As MicroFour.StrataFrame.UI.Windows.Forms.IBusinessBindable
'-- Cycle through the bound controls
For Each loItem In Me.BoundControls
If loItem.BindingField.Equals(FieldName) Then
loControl = CType(loItem, Control)
Exit For
End If
Next
'-- Return Results
Return loControl
End Function