Disabling Strataframe-Textboxes

Author Message
 Posted 9/10/2010 4:09:42 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 9/23/2016 12:28:17 AM
Posts: 144, Visits: 618
Hi there,

I don't know if I understand the behaviour of the enabled-property of the strataframe-textbox.

I am trying to disable a textbox (which I understand as that a control can not receive focus and thus can not be edited), which is not bound to a BO-field. When I set the enabled-property to false, the field can still be edited (changed).

When I bind a textbox to a BO it is, as described in the help-file, editable when I change the BO to edit-state.

But when I change the enabled-property for such a field to false to prevent it from being modified when a BO gets in edit-state, it still receives focus and can be changed.

So by now I can't see what the enabled-property really does?

I know I could set the read-only property to true but this does not prevent that a textbox gets focus and I can not change the background-color.

Thanks in Advance

Thomas


Tags:
Post #28311
Add to Twitter Add to Facebook
 Posted 9/11/2010 1:03:46 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 6/15/2019 1:08:46 AM
Posts: 1,920, Visits: 21,109
Hi Thomas.

Use your BO EditingStateChanged event to deal with that.

Private Sub MyBO1_EditingStateChanged( _
    ByVal e As MicroFour.StrataFrame.Business.EditingStateChangedEventArgs) _
    Handles MyBO1.EditingStateChanged
   
    If e.EditingState = MicroFour.StrataFrame.Business.BusinessEditingState.Editing Then
        Me.MyControl.Enabled = False
    End If

End Sub


Edited: 9/11/2010 1:05:33 AM by Ivan George Borges
Post #28328
Add to Twitter Add to Facebook
 Posted 9/13/2010 8:03:01 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 9/23/2016 12:28:17 AM
Posts: 144, Visits: 618
Hi Ivan,

thanks for your help, I will try this. But what about the non-databound-use of the enabled-property of the textbox? Does this not work by design and should I use some other control for this?

Best regards

Thomas
Post #28357
Add to Twitter Add to Facebook
 Posted 9/13/2010 9:24:25 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 6/15/2019 1:08:46 AM
Posts: 1,920, Visits: 21,109
Sorry, Thomas... you did say it was an unbound control, I missed that one.

In this case, just set the control's IgnoreManageReadOnlyState to True.

Post #28359
Add to Twitter Add to Facebook
 Posted 9/13/2010 8:16:35 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 9/23/2016 12:28:17 AM
Posts: 144, Visits: 618
Hi Ivan,

sorry if I did confuse you but I was trying both ways unbound and bound.

Now, thanks to your help everything is working fine.

Best regards

Thomas
Post #28361
Add to Twitter Add to Facebook
 Posted 9/13/2010 10:46:36 PM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 6/15/2019 1:08:46 AM
Posts: 1,920, Visits: 21,109
Glad I could help, Thomas. Wink
Post #28362
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

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.