473,395 Members | 1,456 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,395 software developers and data experts.

Textbox Scroll Issue

Ok, I have trawled google groups for the last hour, and have found no >net
work around to my issue.

Basically my problem is a simple one. I have a multiline textbox and a
command button. When the button is pressed text is appended to the text box.
I would like the textbox to automatically scroll to the end of the data to
be added.
In VB6 I would do it with:

TextBox1.SelStart = Len(TextBox1.Text)

However I can't seem to find a VB.net (2005) workaround.

I have tried:

Textbox1.Focus()
Textbox1.SelectionStart = TextBox1.TextLength

However that didn't work.
If anyone could help me out I would be thankful

Regards.
Dec 13 '05 #1
3 9401
Hi, you nee this:

TextBox1.SelectionStart = TextBox1.TextLength
TextBox1.ScrollToCaret()
TextBox1.Focus()

Hth Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Materialised" <ma**********@privacy.net> schreef in bericht
news:40*************@individual.net...
Ok, I have trawled google groups for the last hour, and have found no >net
work around to my issue.

Basically my problem is a simple one. I have a multiline textbox and a
command button. When the button is pressed text is appended to the text box. I would like the textbox to automatically scroll to the end of the data to
be added.
In VB6 I would do it with:

TextBox1.SelStart = Len(TextBox1.Text)

However I can't seem to find a VB.net (2005) workaround.

I have tried:

Textbox1.Focus()
Textbox1.SelectionStart = TextBox1.TextLength

However that didn't work.
If anyone could help me out I would be thankful

Regards.

Dec 13 '05 #2
Thanks for that Peter.
"Peter Proost" <pp*****@nospam.hotmail.com> wrote in message
news:OE****************@TK2MSFTNGP09.phx.gbl...
Hi, you nee this:

TextBox1.SelectionStart = TextBox1.TextLength
TextBox1.ScrollToCaret()
TextBox1.Focus()

Hth Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Materialised" <ma**********@privacy.net> schreef in bericht
news:40*************@individual.net...
Ok, I have trawled google groups for the last hour, and have found no
>net

work around to my issue.

Basically my problem is a simple one. I have a multiline textbox and a
command button. When the button is pressed text is appended to the text

box.
I would like the textbox to automatically scroll to the end of the data
to
be added.
In VB6 I would do it with:

TextBox1.SelStart = Len(TextBox1.Text)

However I can't seem to find a VB.net (2005) workaround.

I have tried:

Textbox1.Focus()
Textbox1.SelectionStart = TextBox1.TextLength

However that didn't work.
If anyone could help me out I would be thankful

Regards.


Dec 13 '05 #3
"Materialised" <ma**********@privacy.net> schrieb:
Basically my problem is a simple one. I have a multiline textbox and a
command button. When the button is pressed text is appended to the text
box.
I would like the textbox to automatically scroll to the end of the data to
be added.
In VB6 I would do it with:

TextBox1.SelStart = Len(TextBox1.Text)

However I can't seem to find a VB.net (2005) workaround.


Adding a line to a richtextbox control and scrolling it into view
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=richtextboxscrolltobottom&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 13 '05 #4

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

Similar topics

4
by: Mad Scientist Jr | last post by:
I have a textbox that i am adding to (in codebehind of ASP.NET) and need to ensure that the focus is scrolled to the bottom of the textbox each time the page refreshes, and then set focus to a 2nd...
0
by: Alex Moskalyuk | last post by:
I am using System.Windows.Forms.TextBox to publish some real-time data that's coming off the external devices. My data is fed into the TextBox with proper precautions not to exceed the MaxSize...
5
by: Wilfried Mestdagh | last post by:
Hello, textBox += someData + "\r\n"; does not scroll the visible text to the end. How do I perform that ? Also this way seems to me a lot of reallocating memory. Is there better way to add...
4
by: Grant Schenck | last post by:
I want to append text to the end of a text box. If the cursor is currently at the end I just want to append it and have the normal scrolling take place if needed. However, if the selection...
5
by: pphillips | last post by:
On my webform I have a textbox. When the page loads I put some text in the textbox. The text is 2 sentences and all I want to do is to put the sentences on different lines. It use to be so...
5
by: sherifffruitfly | last post by:
Hi, I want to derive of of TextBox, and add on an auto-scroll-to-bottom boolean property. I can use a regular textbox (rich or otherwise) and get the effect by: mytextbox.append("my text");...
7
by: robert.waters | last post by:
I have an Access database frontend linked via ODBC to a large (gigabytes) mysql database. I need to view a large amount of data in a a textbox (variable up to 300K), but I receive a 'there isnt...
8
by: fniles | last post by:
I am using VB.NET 2008. I would like to search a textbox (find next and find previous), and when it finds the text, move my cursor in the textbox to where the found text is. How can I do that ?...
1
by: newbie009 | last post by:
How can I disable horizontal scroll in textbox for FireFox? Right now 1 textbox has vertical scroll and other textbox has horizontal scroll. It only looks like this on FireFox but it looks ugly....
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.