We help IT Professionals succeed at work.

removing scroll bar from richedit control

pjn
pjn asked
on
Medium Priority
653 Views
Last Modified: 2013-11-20
How do I remove the automatic vertical scroll bar from a rich edit control  ? (the scroll bar  is automatically added when the number of lines exceeds the visible lines in the view ). I have tried modifying the window's style so that WS_VCSROLL is removed, but this does not solve this problem. I want to do this dynamically because there are certain places in the program where I do want a scroll bar to appear in the rich edit control.
Comment
Watch Question

Hi,
Try using CWnd function ShowScrollBar(). This function will hide or show the scrollbars.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
pjn

Author

Commented:
ShowScrollBar was nearly it but I get a big flicker where the toolbar was and then it was removed. My program uses the rich edit control as a log and hence this problem is really bad. If had tried you suggest with SetRedraw and LockWindowUpdate but no cigar. Any other ideas.
Sorry,
I have no idea for that problem. May be if you could elaborate more on how exactly you are using the rich edit control, one can get the solution.
pjn

Author

Commented:
I am using the rich edit control to write continous logging information into. This is happening quite fast and evertime I add some text to the control which goes beyond the current depth the rich edit control automatically adds a vertical scrollbar. What I want to do is while sending information to the rich edit control is to disable the vertical scroll bar. It is very disconcerting seing the scrollbar recalculate its size everytime I add some text to it. Hopefully by removing the scrollbar, this will speed things up also. Then when I have finished adding the text to the control, I can reenable the scrollbar so the user can leaf back up through the log.
Hi,
I cannot solve your problem.
Sorry.
pjn

Author

Commented:
I fixed the problem myself by adding the following to my Views class constructor

m_dwDefaultStyle &= ~ WS_VSCROLL;

Thanks all the same for the input
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.