Stop a RichTextBox control from scrolling when it has focus

D

D. Yates

Hi,

When a RichTextBox control doesn't have focus, it DOES NOT scroll to the
last line that is added; however, if it does have focus, it WILL scroll to
the last line added. I want to stop and start this behavior at will. When
I stop the behavior, this will give users a chance to examine the text that
is at the top of the document while new text is being added at the bottom.

I have tried inheriting from the RichTextBox control and overriding the
WndProc method to capture incoming WM_VSCROLL messages, but that doesn't
seem to be what is controlling the scroll action. I have placed Trace
statements in the WndProc method to look for the message in question, but I
can't seem to find it. I am beginning to believe that this is the wrong
way to go about solving this problem, so I decided to post to the group and
see if anybody has done or knows how to do this.

By the way, does anybody know where I can find a complete list of windows
messages (e.g. WM_VSCROLL) with their associated numeric values. I have
tried searching the documentation at Microsoft's web site, but it's like
trying to find a needle in a haystack. You would think that you could find
a list in the "See Also" links at the bottom of the SendMessage and
PostMessage methods or at least by looking up a known message name like
WM_VSCROLL, but that would be too easy.

Thanks,
Dave
 
D

D. Yates

I think I posted this to the wrong group.....

I will try posting this to
microsoft.public.dotnet.framework.windowsforms.controls


Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top