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

Vertical Scrollbar

P: 2
Hi,
I have a multilined textbox in a chat program, this textbox recieves incoming messages and shows them to the user. The problem is with the vertical scrollbar.
Every time a new message appears in the textbox the scrollbar goes up to the top of the textbox while the message is being shown in the bottom.

So I wonder how you would do to make the scrollbar go down to the bottom when the user recieves a new message.

Thanks in advance.
May 1 '07 #1
Share this Question
Share on Google+
3 Replies


Expert 5K+
P: 8,434
I think the simplest thing is to move the insertion point (the "text cursor") to the end of the text. Something like this...
Expand|Select|Wrap|Line Numbers
  1. Text1.SelStart = Len(Text1.Text)
(Note that you can actually set it to any sufficiently high number. If you try to go past the end of the text, it's not a problem - Windows just stops at the end.)
May 1 '07 #2

P: 2
Works like a charm, thanks.
May 1 '07 #3

Expert 5K+
P: 8,434
Works like a charm, thanks.
Cool! Glad to help. :)
May 2 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.