I have a panel (Windows Forms) and I want to disable a panels horizontal scrollbar. I tried this:
HorizontalScroll.Enabled = false;
But tha
I think that you're having this problem because the AutoScroll property of your panel is set to true. I made a test solution (.NET 3.5) and discovered the following:
If you try this:
panel.AutoScroll = true;
panel.HorizontalScroll.Enabled = false;
panel.HorizontalScroll.Visible = false;
the HorizontalScroll.Enabled and .Visible aren't changed to false (assuming the panel has controls within that cause autoscroll to show the horizontal scroll bar). It seems that you must disable AutoScroll to be able to change these properties around manually.