Content controls scrolling. Scroll bars are not displayed if they are not needed. A property is usually available that you can set to make them always visible, and just turn it off until you need it.
The AutoScroll
property should be true
, as you already found. But then the contents of the scrollable control should make the parent control display the scroll bars. This part depends on how the controls are embedded in the parent element.
Try these two experiments:
Place a Panel
on the form and attach it to the Fill
. Set the panel's AutoScroll
property to true
. In this panel, place the TextBox
and set it for the dock as Fill
. Also set MultiLine
to true
. Launch the application, and you will notice that the size of both is just the available space ... scrolling cannot happen, because neither the Panel
nor its TextBox
become larger than the occupied space.
Follow the same steps as in # 1, but this time do not attach the TextBox
. Instead, set it to a large size, what you know will be larger than the amount of Panel
that is visible. Starting the application should now scroll the Panel
.
Hopefully this little test will help demonstrate that controls scrolling in a form.
source share