Rich Text Box Vertical Scrolling (VB.NET)
I'm using a rich text box and I'm adding text into it like a text buffer. The problem is, I add the text to the bottom, but it still shows the top. I need a way to make it automatically scroll to the bottom so when text is added onto the bottom, it shows the newest text first, from the bottom.
I've tried every different way I can think of but I can't seem to get it to scroll down automatically.
I've tried :
- .appendtext function
- setting the .SelectionStart point to the end of the buffer and modifying the .SelectedText
- setting rtf.text = rtf.text + newtext
- using .focus before and after adding the new text
Is there some other method that I'm unaware of to do this? It seems like such a stupid and trivial problem, I feel stupid just posting this but I've tried everything I can think of with no luck whatsoever.
also, i tried searching gamedev but the search function is down =(
I'm not sure if you can do this in VB.NET directly but you could declare a function "SendMessage" out of "user32.dll" and use that with 'EM_GETSCROLLPOS' and 'EM_SETSCROLLPOS'. You'll have to check the defines for those consts.
This is probably not the best way to do it, especially if there is a direct way to do this in VB.NET.
HTH anyway
This is probably not the best way to do it, especially if there is a direct way to do this in VB.NET.
HTH anyway
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement