Solved

TextBox scrollbar

Posted on 2004-10-20
4
890 Views
Last Modified: 2010-05-18
Using vb.net 2002 code; how can I use a picturebox on the right side of a textbox to scroll the text into view 3 incriments at a time and another picturebox on the left to scroll it back again 3 incriments at a time.
0
Comment
Question by:teamdad
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
arif_eqbal earned 500 total points
ID: 12366618
What do you want to Scroll the TextBox on the Form or the Text within the Text Box.

Why no you use ScrollBars within the TextBox if your TextBox is multiline and you want it to be scrolled.

However if you want to click on a Picture Box and you want the Lines in a Multiline textBox to scroll you can even achieve that,
Set the Caret position to say the Third Line using TextBox1.SelectionStart and setting TextBox1.SelectionLength=0

and then call TextBox1.ScrollToCaret to scroll the text...

0
 

Author Comment

by:teamdad
ID: 12366752
I have tried the horizontal scrollbar in properties of the textbox and I set it to multiline and the scrollbar don't show up even if text is more than what can fit in the visible part of the textbox.  Suggestions on what might cause it / how to fix it or write a small working example of doing the caret position and scroll to caret.
0
 
LVL 19

Expert Comment

by:arif_eqbal
ID: 12366827
Well if ScrollBar is OK for you use that only avoid Scrolling to caret and all

Now For Showing Horizontal ScrollBar you need to set the WORDWRAP property to FALSE
0
 

Author Comment

by:teamdad
ID: 12373907
I'm still working with it..... does anyone have a working example of the TextBox1.ScrollToCaret way to scroll with a picturebox.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now