|
-
May 15th, 2004, 09:10 AM
#1
Thread Starter
Hyperactive Member
Textbox Question [Resolved]
I remember in VB6 when you added a new line to a multiline text box, the line would be added to the botton of all the text. Then if you wanted to have the last text entered displayed, you would do SelStart = Len(Text) and this would cause the scrollbar to be pulled all the way to the bottom of the textbox so you could see the last text added.. I can't get this to work in VB.Net.. Can anyone tell me how to do this? When I do something like this:
txtOutput.SelectionStart = txtOutput.TextLength
The scroll bar bounces back to the top most position after ever entry.. How do I make is so I can see the bottom portion of the test after an entry has been added?
Last edited by Hinder; May 16th, 2004 at 06:48 AM.
-
May 15th, 2004, 02:40 PM
#2
set HideSelection to False " txtOutput.HideSelection = False "
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
May 15th, 2004, 05:17 PM
#3
Hi.
You almost got it right. Problem is your code only set's the caret position. After that you need to execute the ScrollToCaret method.
That should to do it.
VB Code:
txtOutput.SelectionStart = txtOutput.TextLength
txtOutput.ScrollToCaret()
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
-
May 15th, 2004, 05:25 PM
#4
Thread Starter
Hyperactive Member
Originally posted by pax
Hi.
You almost got it right. Problem is your code only set's the caret position. After that you need to execute the ScrollToCaret method.
That should to do it.
VB Code:
txtOutput.SelectionStart = txtOutput.TextLength
txtOutput.ScrollToCaret()
Thanks, that works great...
-
May 15th, 2004, 08:26 PM
#5
Don't forget to add resolved to your message. I spent hours the other day trying to find info like this, many of them unresolved or not quite what i wanted, shoulda waited a couple of days lol.
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
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
|