C# WPF horizontal scrollbar for ScrollViewer RepeatButtons only on either side of contents
Is there a way to get a scroll viewer with the RepeatButtons only and to force the buttons to the edge of the contents?
I want it to look like this:
+---+-------------------------------------------------------------+---+
| | | |
| < | Contents here...............................................| > |
| | | |
+---+-------------------------------------------------------------+---+
Where the middle is the content of the ScrollViewer, and the left and right are RepeatButtons which will scroll the contents.
I was thinking I could either use a cu开发者_如何学JAVAstom ScrollBar (but I don't know much about this or how to make the buttons go outside the content), or I could just use RepeatButtons and connect their click to the ScrollViewer. Which way (if either) would be better/easier?
I see no reason you cannot use a ScrollViewer. Configure the event handlers of your two arrows (left/right) to minipulate ScrollToHorizontalOffset() and ScrollToVerticalOffset.
精彩评论