Easy way to get scrollbars to appear outside of data area of a graph?
I'm working with a System.Windows.Forms.Panel
that has x-y data rendered in it as primitive graphics.
This panel is placed directly within another System.Windows.Forms.Panel
that has the AutoScroll
property set to True
. As a (not unexpected) result, the scrollbars appear when I zoom in with the contained panel.
A side effect of this is that when the horizontal scroll bar appears, it appears within graph area, which reduces the height of the viewable area of the graph, which causes the vertical scrollbar to appear. (Again, this is probably what it's supposed to do.) So, I get both scrollbars, even when I mean to stretch the graph out only in the x direction.
Having the bottom part of the vertical data just out of reach in the client area (and needing to scroll vertically to get there) all the time is annoying to my开发者_运维知识库 customers. It seems that the way to fix this is to have the scrollbars appear outside of the viewable area so that the viewable area is not changed when the scrollbars appear.
Is there an easy way to do this? Thanks as always.
Edit: I'm not the original author of this code, and putting in a newer chart component like System.Windows.Forms.DataVisualization.Charting.Chart
is a better long-term solution, but I'm on a small time crunch here for now.
精彩评论