Custom scroll bar renderer

Posted by: kbj on 22 December 2019, 12:45 am EST

  • Posted 22 December 2019, 12:45 am EST

    In order to have a cohesive user experience, I would like the fpspread scrollbars to look and act the same as say the scroll bars in the C1InputPanel. The FlatScrollBarRenderer is close. I am trying to write my own renderer implementing IScrollBarRenderer) but cannot see how any of the drawing subs know if the element is being hovered over or pressed.
  • Replied 22 December 2019, 6:00 pm EST


    You can use the "EnhancedScrollBarRenderer" to customize the scrollbar of the spread. Please refer to the following line of code:

    FarPoint.Win.Spread.EnhancedScrollBarRenderer enhancedScrollBarRenderer1 = new FarPoint.Win.Spread.EnhancedScrollBarRenderer();
    enhancedScrollBarRenderer1.ArrowColor = System.Drawing.Color.Navy;
    enhancedScrollBarRenderer1.ArrowHoveredColor = System.Drawing.Color.Navy;
    enhancedScrollBarRenderer1.ArrowSelectedColor = System.Drawing.Color.Navy;
    enhancedScrollBarRenderer1.ButtonBackgroundColor = System.Drawing.Color.LightSteelBlue;
    enhancedScrollBarRenderer1.ButtonBorderColor = System.Drawing.Color.SteelBlue;
    enhancedScrollBarRenderer1.ButtonHoveredBackgroundColor = System.Drawing.Color.DeepSkyBlue;
    enhancedScrollBarRenderer1.ButtonHoveredBorderColor = System.Drawing.Color.DeepSkyBlue;
    enhancedScrollBarRenderer1.ButtonSelectedBackgroundColor = System.Drawing.Color.SteelBlue;
    enhancedScrollBarRenderer1.ButtonSelectedBorderColor = System.Drawing.Color.LightSteelBlue;
    enhancedScrollBarRenderer1.TrackBarBackgroundColor = System.Drawing.Color.LightSkyBlue;
    enhancedScrollBarRenderer1.TrackBarSelectedBackgroundColor = System.Drawing.Color.SteelBlue;
    this.fpSpread1.HorizontalScrollBar.Renderer = enhancedScrollBarRenderer1;

    Hope it helps.

  • Replied 23 December 2019, 1:22 am EST

    Hi Mohit,
    The EnhancedScrollBarRenderer does not look exactly like the scrollbars found in The C1 controls. So if I am still wishing to write my own renderer that will perform and look as they do. So my question stands. How do I know the hover and pressed states of the parts of the scroll bars when they are to be painted? Since the FlatScrollBarRenderer does this using the IScrollBarRenderer albeit with inaccessible hover and pressed colors, there must be a way.
  • Replied 23 December 2019, 10:31 pm EST


    I have escalated the issue to our development team(SPNET-1260) and will inform you once I get any information from them.

  • Replied 1 February 2020, 9:23 am EST

    It's been over a month, any update?
  • Replied 3 February 2020, 12:58 am EST


    I have asked the development team for an update on the issue.

  • Replied 4 February 2020, 11:15 pm EST


    Currently, it is not possible to add a custom scrollbar in the spread as of now.

    Sorry for the inconvenience caused to you.

  • Replied 5 February 2020, 4:37 pm EST


    FYI, our development has taken this into consideration. If they found it feasible, they will add the same in a future build of spread.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels