|
-
Jul 17th, 2008, 02:11 PM
#1
Thread Starter
Frenzied Member
How to bring the RichTextBox vertical scrollbar to lowest position ?
Hi all . i am adding data to richtextbox and want the scrollbar to move to lowest position each time data get entred. Could you any show me how that can be done.Thabnks
2 Code:
form1.RichTextBox1.Text = ChatText$
Last edited by tony007; Jul 17th, 2008 at 02:20 PM.
-
Jul 17th, 2008, 02:16 PM
#2
Re: How to bring the RichTextBox vertical scroller bar to lowest position ?
If you use SelText and SelLength together to add the new text to the bottom, the view scrolls to the position the text was added to.
-
Jul 17th, 2008, 02:25 PM
#3
Thread Starter
Frenzied Member
Re: How to bring the RichTextBox vertical scrollbar to lowest position ?
thanks for you reply. how to lower the scrollbar to the botom each time new data get added so the user sees the fresh data without manully scrolling down. Could you show me how to use selText and sellength ?
Last edited by tony007; Jul 17th, 2008 at 02:33 PM.
-
Jul 17th, 2008, 02:33 PM
#4
Re: How to bring the RichTextBox vertical scrollbar to lowest position ?
Code:
Sub AddNewLine(ByRef ChatLine As String)
RichTextBox1.SelStart = Len(RichTextBox1.Text)
RichTextBox1.SelText = vbNewLine & ChatLine
RichTextBox1.SelStart = Len(RichTextBox1.Text)
End Sub
Now you can call AddNewLine to add the new line of chat log.
The problem that remains is that the chat log can't be scrolled conviniently as it always goes down even if user is scrolling to see the old log.
-
Jul 17th, 2008, 03:38 PM
#5
Thread Starter
Frenzied Member
Re: How to bring the RichTextBox vertical scrollbar to lowest position ?
Mery many thanks it work well. But only problem is that for some reason when i enter the data there is empty space between each line !! Is there away to avoid those empty lines ?Thanks
-
Jul 17th, 2008, 03:39 PM
#6
Re: How to bring the RichTextBox vertical scrollbar to lowest position ?
On that case I guess you're adding a line change yourself, so simply taking away the vbNewLine from the above code should work just fine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|