Disabling Strataframe-Textboxes


Author
Message
Thomas Holste
Thomas Holste
StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)
Group: StrataFrame Users
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
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
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 14 Years Ago by Ivan George Borges
Thomas Holste
Thomas Holste
StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)
Group: StrataFrame Users
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
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
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.


Thomas Holste
Thomas Holste
StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)
Group: StrataFrame Users
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
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Glad I could help, Thomas. Wink
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