kejpa Posted February 18, 2005 Posted February 18, 2005 Hi, I have a textbox that shows the trace output of my app. After the text is updated I always see the first line. I'd really like it in another way. If the caret is at the last position of the textbox I want to see the end of the text box. If it's in another position I'd like to keep it there and have that row visible. I can't find any methods for scrolling the textbox to the caret position, help please! /Kejpa Quote
stustarz Posted February 18, 2005 Posted February 18, 2005 If you used a RichTextBox that has a ScrollToCaret method. Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
coldfusion244 Posted February 18, 2005 Posted February 18, 2005 [CS]textbox.SelectionStart = textbox.Text.Length; textbox.ScrollToCaret();[/CS] Quote -Sean
kejpa Posted February 18, 2005 Author Posted February 18, 2005 :o It was that simple. I ought to be ashamed of myself for not figuring it out.... Thanks anyway! /Kejpa, somewhat embarrased Quote
Leaders snarfblam Posted February 20, 2005 Leaders Posted February 20, 2005 The thing about the textbox is that when the text is changed the caret doesnt move to the end. There is no caret. The SelectionStart property is set to -1, signifying that the caret isnt anywhere i suppose. So you need to move the caret to the location that you want to be visible. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.