0
votes

I am trying to enable scroll bars for my windows form application. When I set the AutoScroll property to true, only the Vertical Scroll Bar is appearing and working. The Horizontal scroll bar is not showing at all. I do have panels within my form, but I'm not sure if/how this causing a problem. How can I make both scroll bars to work?

1
AutoScroll will only set the canvas size based on the controls on the form. It sounds like you don't have any controls to the right of the form.LarsTech
You should have controls placed beyond the size of the form to see scrollbarsAbdul Saleem
I have controls on the form. My understanding is that when the form is resized while running, the scroll bars would pop up? Is this not correct?SQlBeginner
Yes and no. We can't see your form for here. If the controls are in a panel and your panel is docked, then no.LarsTech
Ah I see, I had the panels docked to the top....I didn't realize that had any affect. Thanks LarsTechSQlBeginner

1 Answers

2
votes

If the controls are inside a panel, and the panel has a Dock style set, that can affect the behavior of the AutoScroll functionality.

To have AutoScroll work properly for both vertical and horizontal scrollbars, you would have to set the panel's Dock property to DockStyle.None.