Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

How can i set a TextBox to show the last line when it's multi line?

 

I'm trying to make it a kind of status window, so i enter "some text" into it, then later "some more text" and eventually it's got enough lines that the vertical scroll bar shows up, but it stays at the top instead of scrolling down to show the new line.

 

I figure it's just a simple "scroll to line" or something, any input? I'm using c#.

Can't afford to be neutral on a moving train...
Posted
Oh and another thing, how can i make it so the text in the TextBox appears at the bottom instead of the top when there's only one line?
Can't afford to be neutral on a moving train...
  • Moderators
Posted

try this...

'Place the caret at the end of the textbox
TextBox1.SelectionStart = TextBox1.Text.Length 

'scroll to caret (as the method says)
TextBox1.ScrollToCaret()

'all subsequent enties should be appended
TextBox1.AppendText("Some additional text")

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...