CRichEditCtrl: how to get scroll bars?

16 Views Asked by At

I have a rich edit control (CRichEditCtrl, v2.0) in an MFC dialog-based app. The control is used only for displaying formatted text. When I fill the control with more text than will fit, I'd like scroll bars to appear (mostly interested in vertical scroll bar, but having horizontal also would be nice).

I cannot find any way to do this in the rich edit docs. I could add independent scroll bar controls to the dialog, but this seems like unnecessary work.

I have tried

re.ModifyStyle(0, WS_VSCROLL, SWP_FRAMECHANGED);

where re is the subclassed control in the dialog, which does produce a scroll bar, but it has the wrong thumb size and does not allow scrolling to all the test in the control.

windows 11; Visual Studio 2022; C++

0

There are 0 best solutions below