473,809 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.SelSta rt = Len(TextBox1.Te xt)

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

I have tried:

Textbox1.Focus( )
Textbox1.Select ionStart = TextBox1.TextLe ngth

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

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

TextBox1.Select ionStart = TextBox1.TextLe ngth
TextBox1.Scroll ToCaret()
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)

"Materialis ed" <ma**********@p rivacy.net> schreef in bericht
news:40******** *****@individua l.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.SelSta rt = Len(TextBox1.Te xt)

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

I have tried:

Textbox1.Focus( )
Textbox1.Select ionStart = TextBox1.TextLe ngth

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******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi, you nee this:

TextBox1.Select ionStart = TextBox1.TextLe ngth
TextBox1.Scroll ToCaret()
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)

"Materialis ed" <ma**********@p rivacy.net> schreef in bericht
news:40******** *****@individua l.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.SelSta rt = Len(TextBox1.Te xt)

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

I have tried:

Textbox1.Focus( )
Textbox1.Select ionStart = TextBox1.TextLe ngth

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

Regards.


Dec 13 '05 #3
"Materialis ed" <ma**********@p rivacy.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.SelSta rt = Len(TextBox1.Te xt)

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=richtextbox scrolltobottom& 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
7228
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 textbox (which the user types input into). I have tried a couple functions I found posted online but they don't work (see below) The closest I got was using the scrolldown method:
0
2655
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 limit. I use the AppendText() method of the TextBox class and tried playing with ScrollToCaret(), but that didn't seem to do anything different than normal behavior. I am getting the TextBox that supports auto-scrolling on some machines (i.e. the...
5
31009
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 text to a textbox ? -- rgds, Wilfried
4
6994
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 isn't at the end of the text box I want to append the text but WITHOUT changing the selection or scrolling the text. I can easily tell if the selection is at the end or not. However, I haven't found away to prevent the scrolling when I AppendText.
5
1556
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 simple: textbox1.text = "Sentence1." & vbCrLf & "Sentence2." The above doesn't seem to work the sentences are on the same line. Please help with this simple thing.....
5
2664
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"); mytextbox.focus(); mytextbox.scrolltocaret();
7
2912
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 enough memory' error whenever I scroll past N number of bytes in a textbox that has been filled with a lot of data. I am not sure what N is, but for a large chunk of data it occurs at about the halfway scroll, and smaller chunks might not throw...
8
4904
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 ? Thank you
1
4367
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. http://jumbofiles.com/example.gif I used this code but it only worked for IE not FireFox: style="overflow: scroll; overflow-y: scroll; overflow-x: hidden; overflow:-moz-scrollbars-vertical;" Basically I want only vertical scroll.
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9601
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10379
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7660
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
3014
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.