tags:

views:

1980

answers:

1

Is there a way to inject a panel with a custom scrollbar?

I have the following issues with the current scrollbar:

  • the software I create has to work on both Compact framework and full framework
  • on the cf a touchscreen is attached and the default scrollbars aren't touchscreen-friendly
  • On the full framework the behavior of the scrollbars is sometimes strange.
  • All the controls are skinnable in the application, and so is my current custom scrollbar, but the looks of the default scrollbar doesn't fits with all the skins.

One way is to have 2 panels as one custom control and move the one over the other, but I prefer not to implement it that way becaus of all the overhead.

+1  A: 

You have to bear some overhead with this approach. Set the "AutoScroll" property of Panel to false. Set a VScrollBar and process it with the Panels resize events.

Sachin Gaur