How to control scrolling

6 posts, 0 answers
  1. Ofer
    Ofer avatar
    14 posts
    Member since:
    Apr 2009

    Posted 25 Jun 2009 Link to this post

    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!

  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 26 Jun 2009 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ofer
    Ofer avatar
    14 posts
    Member since:
    Apr 2009

    Posted 29 Jun 2009 Link to this post

    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!
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 02 Jul 2009 Link to this post

    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.
  6. Stefan Urabl
    Stefan Urabl avatar
    4 posts
    Member since:
    Feb 2010

    Posted 21 Apr 2010 Link to this post

    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



  7. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 26 Apr 2010 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready