471,325 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

Stop a RichTextBox control from scrolling when it has focus

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
Jan 5 '06 #1
4 3447
You can get the message values from the header files installed with VC.

D. Yates wrote:
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

Jan 5 '06 #2
someone just posted this link as well for a question I had asked and the
website has EVERYTHING as far as message values etc go:

www.pinvoke.net

Benny Raymond wrote:
You can get the message values from the header files installed with VC.

D. Yates wrote:
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

Jan 5 '06 #3
Thanks Benny.
Jan 6 '06 #4
I think I posted this to the wrong group.....

I will try posting this to
microsoft.public.dotnet.framework.windowsforms.con trols
Dave
Jan 6 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Rachel Suddeth | last post: by
8 posts views Thread by Grant Schenck | last post: by
reply views Thread by Jean-Francois Lord | last post: by
7 posts views Thread by Richard | last post: by
1 post views Thread by Daniel Friend | last post: by
1 post views Thread by dotnetnoob | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.