0
votes

I want a multiline CEdit control to scroll itself downside slowly like a rolling subtitle.

So far, I use CEdit::LineScroll() in OnTimer() event. It can do a full line roll with is not as smooth as I expected. I try to replace LineScroll() by ScrollWindow() so that I can scroll the text by pixels however the ScrollWindow() function don't draw the new text lines which should be scrolled into the control.

Anyone have any idea on how to achieve this?

In case I did not describe the issue clear. I add these gifs: What LineScroll() do (and I just need it smoother):

LineScrool

And this is what ScrollWindow() do (the following text is cut):

ScrollWindow

Here is the code of ScrollWindow():

CRect clientRect;
m_editAns.GetClientRect(&clientRect);
m_editAns.ScrollWindow(0, -10, NULL, &clientRect);
m_editAns.UpdateWindow();
ValidateRect(&clientRect);

*PS: The project uses the CEdit control else where so I can't replace it by another control, though inheritance is acceptable.

1

1 Answers

0
votes

According to CWnd::ScrollWindow,

To repaint the uncovered area at the same time the scrolling is done, call the UpdateWindow member function immediately after calling ScrollWindow.