• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 908
  • Last Modified:

TextBox scrollbar

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
teamdad
Asked:
teamdad
  • 2
  • 2
1 Solution
 
arif_eqbalCommented:
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
 
teamdadAuthor Commented:
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
 
arif_eqbalCommented:
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
 
teamdadAuthor Commented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now