Link to home
Start Free TrialLog in
Avatar of jtwine100697
jtwine100697Flag for United States of America

asked on

Scrolling in a Rich Edit control (again...!)

  (This problem was posted before, but the solution that I decided to used is not working on every system!)

   OK...  First the long description:

   When I add text to a Rich Edit control, most of the time, it will not scroll to the added text, so I have to manually scroll to make it visible.  The problem is, I am able to scroll down so far that no lines are visible (but the API docs tell me that I cannot do this!)

   What I need to do is add text, via StreamIn(), and scroll it so that the added text is visible.

   Here are the problems:

   The size of the Rich Edit control area is variable, at runtime, and the fonts and font-sizes used in the Rich Edit control are variable as well.

   Now, the short description:

   If you scroll (via code) a Rich Edit control so that only one line is visible at the TOP, and then click (not move) the scrollbar, the control will adjust itself so that the last line is the last visible line.  That is what I need: a way to make the last line in the control the last visible line, every time.

   Lastly, a request:  The last time I had this problem, I got some responses that obviously were not tested, or the question was not understood.  I promise not to waste your time, if you do not waste mine! :)

   Thanx!

-=- James.
ASKER CERTIFIED SOLUTION
Avatar of anichini
anichini

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jtwine100697

ASKER

  This is EXACTLY what I am looking for...  Much thanx!

   And, BTW: the comment at the end of my question was not meant to offend.  I, too, have a job, and have been programming for quite some time.  I only wrote that comment as it prevents a constant exchange of information, and thus a waste of time.

   Note that I do not ask others to do something unless I would not do it myself: When I *answer* questions, it is because I am pretty sure of my answer; I am not asking others to test my theory.  (See my previous answer on sharing CMap-using-classes across multiple threads.)  When I *comment* on them, that is because I am offering a suggestion, not a fix!

   Thanx again for your time.

-=- James