It's an old post but the issue is ongoing and related posts just keep on arriving on SO
!
I'm doing the necro thing here rather than addressing a more recent question only because it comes top of my google search
The question is simple: "why won't the damn scrollbars appear on my ScrollableControl
?"
But there can be no specific, definitive answer. Because the causes are legion. Because whether or not scrollbars appear on a control depends:
- not only upon it's own properties settings
- but also upon the state of it's parent control
- and also the states of any child controls.
It's easy to fall into the trap of randomly twiddling prop-values until the cows come home. Or go on the i/webs &hope to find some SO
foos. But oh dear. Here is a handful of related SO
posts with an outstanding variety of proposed resolutions:
Horizontal Scrollbar is not visible on DataGridView
Horizontal scrollbar not showing on my textbox
How to set scroll bar in Windows form
How to make scrollbars appear in a resizable panel when the contained control is too big for it?
Scrollable Form in c#, AutoScroll=true doesn't work
How to get scrollbar in Panel in VB.Net?
There are screen-shots of VS-designer
property pages (like here) & even some extreme code-based solutions... my favourites:
Add vertical scroll bar to panel in .NET
how to add Vscroll control to form in Visualbasic.net?
/sighs/
A general answer
..in the form of a minimal github solution in order to explore some of the .NET scrollbar voodoos:
https://github.com/violet313/TestWinForms/tree/Test1-Body-Panel
It's a Visual Studio 2015
solution using the .NET4.52 framework
.
In the solution i am trying to create a form that responds to some dynamic text data that is to be displayed. here's the basic lay-out i am ultimately seeking:
--------------------------------------------------
| fixed-size form header | |
------------------------------------| side |
| | panel |
| dynamic content panel | stuff |
| | |
--------------------------------------------------
| fixed-size form trailer |
--------------------------------------------------
I want the form to:
Grab it, go thro each of the (only 9 starting from 95dccc5)commits and then test your requirements in a sane & incremental fashion. be sure to branch whenever you make a dubious state-change.
Irl: maybe i'm a thicky but it took me over an hour reading the MSDNs trying (&failing) to figure-out the .NET forms control property contingencies. doing structured trial-and-error this way took me only 20mins to get what i wanted.
y~bwc
i know this here is a yeaz ~but who cares? but i had to get if off my chest. heh :
grrr. having to unlurk &answer this question arises out of my need to
profitably take on Microsoft contract work. paymasters can be
relatively (from a developer pov) non-technical and, having read lots
of stuff including the words: quick, simple, straight-forward, secure,
etc, come away with the impression that things .NETish is a stroll in
the park. My issue with this is that i would then have difficulty
trying to reasonably explain why they might need to pay me for n-day's
worth of work in order to get a simple scroll-bar to appear on a
responsive form.
On this occasion, i never got that far. lol. i spent a few hours
wading thro the MSDN blahs trying to make it happen. and then yawned,
gave up, &moved on with a pragmatic implementation. which was
accepted. but it's now the w/end and i am an ocd fool who cannot let
things be.