473,383 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

can I make a text box do this?

djc
I'm looking for a way to display text information on a windows forms app in
a way that as new information is added the newest info is always visible.
The best way to explain is this:

A regular textbox control would work perfectly fine for me if only as I
append text to it, it scrolled to the bottom so the newly added info is
visible and older info can scroll off the top of the textbox.

can I make a text box do this? or is there another control I could use to do
this? I need a control to use as an output screen that will be coninually
written to by several other components of the program. A 'status' output, if
you will.

any input would be greatly appreciated, thanks.
Feb 28 '06 #1
2 1078
Hi Djc
You can use ScrollToCaret Method of TextBox (.Net 2.0)
In the following code snippet, I have two textbox, textbox1 is
MultiLine, and a Button:

private void button1_Click(object sender, EventArgs e)
{
textBox1.Text +=textBox2.Text +Environment.NewLine;
textBox1.SelectionStart = textBox1.Text.Length - 1;
textBox1.ScrollToCaret();

}

if you type text in textbox2 and click the button, the new text is
always visible

I hope this helps
A.Hadi

Feb 28 '06 #2
djc
Thank you. I appreciate it.

<AH****@gmail.com> wrote in message
news:11*********************@p10g2000cwp.googlegro ups.com...
Hi Djc
You can use ScrollToCaret Method of TextBox (.Net 2.0)
In the following code snippet, I have two textbox, textbox1 is
MultiLine, and a Button:

private void button1_Click(object sender, EventArgs e)
{
textBox1.Text +=textBox2.Text +Environment.NewLine;
textBox1.SelectionStart = textBox1.Text.Length - 1;
textBox1.ScrollToCaret();

}

if you type text in textbox2 and click the button, the new text is
always visible

I hope this helps
A.Hadi

Feb 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Akseli Mäki | last post by:
Hi, Hopefully this is not too much offtopic. I'm working on a FAQ. I want to make two versions of it, plain text and HTML. I'm looking for a tool that will make a plain text doc out of the...
4
by: Peter Scott | last post by:
I created a table that has a column in that needs to contain a full Unix file path. Since 2048 was too long for a VARCHAR, I made it TEXT. I since populated the table. Now I want to make the...
1
by: Joe | last post by:
Hi, I have a login script and right now it is not case sensitive. I want to make it case sensitive. The userid and password is stored in MS Access DB and not in web.config. Can someone give me...
4
by: NH | last post by:
Hi, I just cannot get this to work. I want to make a cell editable in a datagrid only if the value of another cell is something specific. I am able to capture the value of the other cell via the...
9
by: Jason | last post by:
If I've got Me.RichTextBox1.Text = "In Ricn Tex Box" Me.RichTextBox1.Text &= "Line two" & vbCrLf How do I make the first line appear BOLD?
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
28
by: Steven Bethard | last post by:
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions!...
7
by: Steven Bethard | last post by:
I've updated PEP 359 with a bunch of the recent suggestions. The patch is available at: http://bugs.python.org/1472459 and I've pasted the full text below. I've tried to be more explicit about...
13
by: birdboy272 | last post by:
I would be cool if I could develop a 3 by 3 grid that all row, column and diagonals adds up to 15, using numbers ranging from 1 to 9. When click the "check sum button" this application should Sum...
3
by: skanemupp | last post by:
is there anyway to make this shorter? i hate having these big blocks of similar-looking code, very unaesthetic. maybe doesnt matter good-code-wise? anyway can i make some function that makes this...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.