How to allow scrolling in a readonly text box


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I have lots of instances where I have a textbox that will have more text than can be displayed in the viewable area. When the textbox is bound to a BO field, the only way to be able to scroll (that I've figure out) is to edit the text. Obviously this won't work when the user has readonly access. How do I allow scrolling and keep the field readonly?
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
You can set the the IgnoreManageReadonlyState property on the textbox to True, set the Readonly property on the textbox to True and there you go...Smile
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
OK, but this means I have to manually react to all of the appropriate events to manage the readonly stat right? What I'm saying is that the user will want to be able to read all of the text when it is readonly, but when they hit edit, they can edit it. What events do I need to react to? Or what part of the SF code should I look at so I can figure out how to recreate what you are providing, albeit with a slightly different functionality for when the textbox is readonly?
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
If you want to control the functionality within the form, then you will need to handle the EditingStateChanged event of the business object.  If the stat is Idle, then change the controls to ReadOnly, otherwise, set them to editable. 

However, if you want to control this from within the controls themselves, you will need to create your own textbox.  The easiest thing would be to copy the source code for the textbox within the StrataFrame source code to your own textbox class and change the BindingEditable property to alter the ReadOnly property, not the Enabled property.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Cool. That sound both doable and no much extra work. Thanks!
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Good to hear... Also, if you are using a 3rd party control suite like DevExpress or Infragistics, you can just change the disabled colors of the controls.

The reason we went with disabled instead of read-only is that only the textbox has a ReadOnly property... so all of the other controls looked rather strange when only the textboxes were ReadOnly and all of the others were disabled.

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