how to set the carret to the end of a text box (or automatic scroll)

  • Thread starter Thread starter Niu Kun
  • Start date Start date
N

Niu Kun

Will the WordWrap porperty be useful?
(e-mail address removed) 写é“:
 
Will the WordWrap property be useful?
And don't forget the ScrollBars.Vertical property.
Hope that this will help.

(e-mail address removed) 写é“:
 
Hi group,

i'm setting a (long) string in my textbox
textBox1.Text += s + Environment.NewLine;

but if the text is longuer than the visible capacity of the textbox, I
can't see the end of my text (that is the most important), even if the
scrollbar is set.

I would like to see automatically the end of the textbox

how can i do ?

thanks for your answer

N.
 
Hi N,

You can set the caret position by setting the TextBox.SelectionStart property. To set the caret to the end of the text use

textBox1.SelectionStart = textBox1.TextLength;
textBox1.ScrollToCaret();
 
Hi N,

You can set the caret position by setting the TextBox.SelectionStart property. To set the caret to the end of the text use

textBox1.SelectionStart = textBox1.TextLength;
textBox1.ScrollToCaret();





Hi group,
i'm setting a (long) string in my textbox
textBox1.Text += s + Environment.NewLine;
but if the text is longuer than the visible capacity of the textbox, I
can't see the end of my text (that is the most important), even if the
scrollbar is set.
I would like to see automatically the end of the textbox
how can i do ?
thanks for your answer

--
Happy coding!
Morten Wennevik [C# MVP]- Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -


Thanks Morten,
this solves my problem

Best regards,

N.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top