|
| Auto scrolling a textbox control |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.general.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| Ben Urbanski |
| GOOD ANSWER |
Hello,
Does anyone know how it can auto scroll a textbox control? I'm using one to display a log to which I append data. I'd like the textbox to scroll down in pace with the data I'm appending. (I'm developing in C#.)
Thanks,
Ben
|
|
|
| |
|
|
| |
| |
| Lion Shi (VIP) |
| GOOD ANSWER |
Hello Ben,
You can scroll the TextBox to the bottom via code. The ScrollToCaret method is helpful to do that. You can set the Caret to the end of the Text and then scroll to it. This is a sample code:
textBox1.AppendText("This is a test string \n"); textBox1.SelectionStart = textBox1.Text.Length; textBox1.ScrollToCaret();
I hope it helps.
Best regards,
Lion Shi, MCSE, MCSD Microsoft Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use. 2001 Microsoft Corporation. All rights reserved. -------------------- Reply-To: "Ben Urbanski" <Click here to reveal e-mail address> From: "Ben Urbanski" <Click here to reveal e-mail address> Subject: Auto scrolling a textbox control Date: Tue, 4 Jun 2002 08:38:44 -0500 Lines: 11 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <uHSyL08CCHA.2172@tkmsftngp04> Newsgroups: microsoft.public.dotnet.general NNTP-Posting-Host: 204.52.250.5 Path: cpmsftngxa07!cpmsftngxa08!tkmsftngp01!tkmsftngp04 Xref: cpmsftngxa07 microsoft.public.dotnet.general:53429 X-Tomcat-NG: microsoft.public.dotnet.general
Hello,
Does anyone know how it can auto scroll a textbox control? I'm using one to display a log to which I append data. I'd like the textbox to scroll down in pace with the data I'm appending. (I'm developing in C#.)
Thanks,
Ben
|
|
|
| |
|
|
| |
| |
| Ben Urbanski |
| GOOD ANSWER |
Very helpful. Thanks, Lion.
"Lion Shi" <Click here to reveal e-mail address> wrote in message news:yeLeNYKDCHA.1884@cpmsftngxa07... [Original message clipped]
|
|
|
| |
|
|
| |
|
|
| |
| Ryan Martin |
| GOOD ANSWER |
(Type your message here)
-------------------------------- From: Ryan
AppendText works faster and with less code. It will scroll also. Textbox1.AppendText(sText)
|
|
|
| |
|
|
| |
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|