This is a migrated thread and some comments may be shown as answers.

How to control scrolling

5 Answers 513 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Ofer
Top achievements
Rank 1
Ofer asked on 25 Jun 2009, 07:27 PM
Hi,

I need to show many lines of text, so sometime there will be a scrollbar when needed.
The control is read-only.

I need to control about the scrolling:
1) Graphic image (and size) of the scroll-bar, up arrow and down arrow
2) delay and speed of repeated scrolling when the user mouse-clicks the up-arrow or down-arrow
3) speed of movement of the scroll-bar when the user moves it with the mouse.

Do you provide this functionality?
If yes, how to write this?
If no, can you suggest an alternative?

Thank you!

5 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 26 Jun 2009, 06:31 PM
Hello Ofer,

Due to the fact that we are using the Microsoft textbox underneath ours, I am afraid that the scrollbars in RadTextBox are not themeable, i.e. you can not change their appearance. For the same reason you can not obtain a reference to the scrollbar so you can not modify the scrolling speed and interval between scrolls while pressing the buttons.

Our text box wraps the standard text box and adds some traits which are characteristic to our other controls, such as theming. We will try to improve this in a future version.

Write back if you have other questions.

 
Kind regards,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ofer
Top achievements
Rank 1
answered on 29 Jun 2009, 09:28 PM
Hi,

Thank you for your answer.

1)
Does the RadVScrollBar provide my requirements?
Which of your controls can use it?

2) Can I develop my own scrollbar, and give the textbox a command to scroll one line up or down without showing the textbox's built-in scrollbar?

Thank you!
0
Victor
Telerik team
answered on 02 Jul 2009, 01:31 PM
Hello Ofer,

You can create a UserControl with RadTextBox and RadScrollBar, turn MultiLine on and disable the standard scrollbars. These properties are in the Behavior group of RadTextBox. Now you have to implement the scrolling logic. When you move the scroll around, you can set the SelectionStart property of RadTextBox which will cause it to scroll to the supplied position. There is no specific way to go about implementing this as you see, but you can choose the direction.

You can change how much to scroll using the LargeChange and SmallChange properties of RadScrollBar. You can change the images and all other aspects of the appearance of RadScrollBar with the help of our Visual Style Builder tool, documentation and tutorials for which you can find here.

Greetings,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Stefan Urabl
Top achievements
Rank 1
answered on 21 Apr 2010, 09:00 AM
Hello

I have a problem with the Scrollbars of a multiline RadTextBox:

If I only set AutoScroll to true but ScrollBars = None, the scrollbar does not appear, even if the text exceeds the area defined by the size.

If I set ScrollBars to Vertical, the vertical scrollbar is always visible, no matter if there is a need to scroll or not.

What do I have to do, to show the vertical scrollbar only when there are too many rows to display them without a scrollbar?

Additionaly, the standard look of the scrollbars is annoying when working with themes. Is there a plan, when themed scrollbars in textboxes will be available (or is it even possible now?)

Thanks in advance



0
Victor
Telerik team
answered on 26 Apr 2010, 02:48 PM
Hello Stefan Urabl,

Thank you for writing.

If you look at the intellisense's documentation string of the AutoScroll property you will notice that it is only relevant when your control is a container control, and when it has child controls. It is not related to text layout.

RadTextBox implicitly inherits from ScrollableControl which is why you are seeing the AutoScroll property.

The behavior you are experiencing with the scrollbars is the standard behavior of Microsoft's TextBox control which is aggregated in RadTextBox. RadTextBox has, in it's Controls collection, a standard TextBox which has been visually tweaked so that its borders and fill fit with the current theme of RadTextBox. The scrollbars belong to the child text box and therefore can not be styled. In order for the scrollbars to be styled we have to create a completely new RadTextBox control for which we do not yet have official plans.

Thank you for understanding.

Kind regards,
Victor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TextBox
Asked by
Ofer
Top achievements
Rank 1
Answers by
Victor
Telerik team
Ofer
Top achievements
Rank 1
Stefan Urabl
Top achievements
Rank 1
Share this question
or