ScrollBar in a winform
Hi, as you can see on the first screen, I have a tableLayoutPanel, and in the middle I have a flowLayoutPanel, in this flowLayoutPanel, i add controls vertically, so i need a scrollbar for this panel to be able to see all of the elements. My problem is : when i use autoscroll, the scrollbar gets ON my elements (2nd screen), moreover i have a not desirable horizontal scrollbar. So i tried to add a scrollbar with tutorials, with some packages like siticone or metroframework, but either it doesn't work or at best it's really not smooth when i scroll. How is it so complicated to make a scrollbar ?
6 Replies
AutoScroll
must be true, WrapContents
false and FlowDirection
mus be TopDown
. Then you just have to have controls that
a. are wider than your FlowLayoutPanel and
b. go over the bottom edge of that panel. Both scrollbars should work fine then.
And yea, the scrollbar will be drawn onto the control, so you should have some extra margin for your controls therewdym by B ?
i added a padding right but it changes nothing
still horizontal bar
my control is not wider than my flowlayoutpanel because i make it take the same Width
and the "AutoScroll must be true, WrapContents false and FlowDirection mus be TopDown" is already what i had
this is my control if it can help (i removed the padding because it didn't work) :