2

I have enabled the panel (winforms) autoscroll and it works well. Only issue is that autoscroll appears on the panel itself and shrinks the viewable area.

Is there any way to place the scrollbar not on the panel but next to it? If it is not possible to relocate, how can I get the size of the autoscroll bar itself to calculate the exact drawing area?

Lati
  • 341
  • 6
  • 18
  • 2
    Are you talking about winforms, wpf, asp.net etc.? – Jason Down Jul 15 '15 at 14:15
  • You can't move where it is located without creating your own control (if you were using WPF you could override the control template and reposition the scroll bar). I'm not sure what you're trying to do exactly, but perhaps this question will help you: http://stackoverflow.com/questions/23911005/c-sharp-winforms-make-panel-scrollbar-invisible – Jason Down Jul 15 '15 at 15:12
  • 1
    And it looks like this answer shows you how you can get the size of the client area, minus the scrollbar: http://stackoverflow.com/a/22811643/9732 – Jason Down Jul 15 '15 at 15:14
  • @JasonDown, Firstly thanks! I guess Panel.ClientSize is the answer. I will check it and update the comment. – Lati Jul 15 '15 at 15:22
  • No problem. I wonder if we should mark this as a duplicate, since it is sort of another way of asking the same thing as the other question. – Jason Down Jul 15 '15 at 15:33
  • @JasonDown, maybe, or I can remove it. But the question at the link wasn't asked for the autoscrollbar – Lati Jul 15 '15 at 15:36
  • Well you can always leave it and the community will decide if they think it is similar enough. Even if it is marked as a duplicate, it is not deleted, so that someone may come upon your question later and find the link to the other question to find a suitable answer. – Jason Down Jul 15 '15 at 15:39

0 Answers0