StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Tab focus for error providerExpand / Collapse
Author
Message
Posted 07/21/2006 3:40:12 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/25/2008 10:33:22 AM
Posts: 318, Visits: 460
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?
Post #1919
Posted 07/21/2006 4:20:23 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 7:08:30 PM
Posts: 4,811, Visits: 4,781
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

Post #1920
Posted 07/21/2006 4:37:19 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/25/2008 10:33:22 AM
Posts: 318, Visits: 460
Thanks Trent, I'll give that a try.
Post #1921
Posted 07/21/2006 4:39:40 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 7:08:30 PM
Posts: 4,811, Visits: 4,781
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.
Post #1922
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 1:54am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.125. 12 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.