×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Editbox Scroll Bars
2

Editbox Scroll Bars

Editbox Scroll Bars

(OP)
Hi All,
I feel I'm having a super idiot moment, but I have an issue with the editbox control.

I have edit box that has some text in it in a form, and when the form is not EDITING (mode), the disabled editbox doesn't allow for scrolling the text vertically. The visible area is about 8 lines, but it's not uncommon in this memo field for the text to significantly exceed it. But I don't want the user to have to click the "Edit" button, just to be able to read the text by scrolling in it.
Am I missing something stupid? I couldn't find a property to match the behavior.
Suggestions?

Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."hammer

RE: Editbox Scroll Bars

Rather than having it disabled, set ReadOnly to .T.

Tamar

RE: Editbox Scroll Bars

I too observed the same effect. Setting either .Readonly to .T. or .enabled to .F. meant that I could not use the scroll bar.

However, if you set the method KeyPress() to NODEFAULT, that should let you scroll up and down, but will not let you edit.

Hope I have this correct and that this helps.

RE: Editbox Scroll Bars

Combine both tips. It's enough to set Readonly=.T.
What happens if you begin to edit is annoying bing sounds telling you, you can't edit. If you press space for a while, for example, that can last very long

Putting a Nodefault into keypress, like Andrew mentions, will kill that. It also works as standalone solution, but you can't switch code at runtime, so I'd opt for a behaviour depending on the readonly setting. Use this in KeyPress:

CODE

LPARAMETERS nKeyCode, nShiftAltCtrl

If this.ReadOnly
   nodefault
EndIf 
Now switching from Readonly=.F. to .T. disables the control.

It's recommendable to let all controls rather go into readonly mode, because copying values can be handy. To have the disabledbackcolor/forecolor you could simply use a readonly_assign method to react to readonly changes with colro changes and make use of the disabled color properties.

Bye, Olaf.



Olaf Doschke Software Engineering
https://www.doschke.name

RE: Editbox Scroll Bars

(OP)
Thanks all. Combined all the suggestions, and have it working just as I wanted. Applied it to the subclass, and all the forms with the editbox control work now. Cool.

Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."hammer

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close