Coloring scrollbar

2 posts, 0 answers
  1. Cuong
    Cuong avatar
    5 posts
    Member since:
    Dec 2013

    Posted 04 Jun 2014 Link to this post


    I have a RadScrollablePanel and I'm trying to figure out how to color the vertical scrollbar through code and not by setting a theme.  Can you tell me how to do that?
  2. Dess
    Dess avatar
    1561 posts

    Posted 09 Jun 2014 Link to this post

    Hello Cuong,

    Thank you for writing.

    You can customize the VerticalScrollbar via code as follows:
    ((FillPrimitive)radScrollablePanel1.VerticalScrollbar.ScrollBarElement.Children[1]).BackColor = Color.Red;
    radScrollablePanel1.VerticalScrollbar.ScrollBarElement.ThumbElement.ThumbFill.BackColor = Color.Yellow;
    radScrollablePanel1.VerticalScrollbar.ScrollBarElement.ThumbElement.ThumbFill.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
    radScrollablePanel1.VerticalScrollbar.ScrollBarElement.FirstButton.ButtonFill.BackColor = Color.Green;
    radScrollablePanel1.VerticalScrollbar.ScrollBarElement.FirstButton.ButtonFill.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
    radScrollablePanel1.VerticalScrollbar.ScrollBarElement.SecondButton.ButtonFill.BackColor = Color.Blue;
    radScrollablePanel1.VerticalScrollbar.ScrollBarElement.SecondButton.ButtonFill.GradientStyle = Telerik.WinControls.GradientStyles.Solid;

    I hope this information helps. Should you have further questions, I would be glad to help.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. DevCraft banner
Back to Top