Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrollbar does not appear on Panel when lines drawn on it (C#)

Tags:

c#

panel

I want to draw some lines and rectangles on a panel. Sometimes it does not fit in panel and I want the scroll bar to appear. I set AutoScroll property to true, but it doesn't work ;(

like image 740
Sali Hoo Avatar asked Jan 21 '26 04:01

Sali Hoo


1 Answers

Set the panel's AutoScrollMinSize property to a something larger than the panel's real dimensions (for example, if your panel is 300 x 200, set the AutoScrollMinSize property to 900 x 600). This will cause both scrollbars to appear, and you should be able to draw on the larger surface.

like image 102
MusiGenesis Avatar answered Jan 22 '26 17:01

MusiGenesis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!