Tab focus for error provider


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Sure.  Like I said, I did not test the code and you might have to make minor change here or there, but this should at least get you started.
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Thanks Trent, I'll give that a try.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Right now there is not a way to do this automatically.  But you can tie this in failry easy.  Below is a sample of one possible way to achieve this.  I did not test this code, but you should get the general idea.

Private Sub MyBO_BusinessRulesChecked(ByVal e As MicroFour.StrataFrame.Business.BusinessRulesCheckedEventArgs) Handles MyBO.BusinessRulesChecked

'-- Establish Locals
Dim loRule As MicroFour.StrataFrame.Business.BrokenRule
Dim loControl As System.Windows.Forms.Control

If e.CountOfBrokenRulesTotal > 0 Then

'-- Get the first broken rule
loRule = MyBO.BrokenRules.ToArray()(0)

'-- Cycle through all of the controls on the form
For Each loControl In Me.Controls
    '-- See if the control supports the IBusinessBindable interface (SF Binding)
   
If loControl.GetType().GetInterface("IBusinessBindable") IsNot Nothing Then

        '-- See if the control matches the field name in error
       
If CType(loControl, MicroFour.StrataFrame.UI.Windows.Forms.IBusinessBindable).BindingField.Equals(loRule.FieldName, StringComparison.OrdinalIgnoreCase) Then

            '-- Set the focus
           
loControl.Focus()

            '-- Exit the loop
           
Exit For

        End If
    End If
Next

End If

End Sub


Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
If I have a form with multiple tabs on it, and there is an error on a tab not focused...is there a way to focus the tab with the error on it automatically?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search