By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,238 Members | 1,804 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,238 IT Pros & Developers. It's quick & easy.

Stop a RichTextBox control from scrolling when it has focus

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
Thanks Benny.
Jan 6 '06 #4

P: n/a
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.