DavidWaldo
DavidWaldo

Reputation: 735

Disable horizontal AutScroll in Winforms, not just scrollbar

I've been fighting a winform panel autoscroll property for past hour and cant get it to work. What i want is to have a vertical scroll but not a horizonatal. I was able to hide the vertical scrollbar, but scroll is still possible by clicking on components close to edge or by mouse wheel.

Before clicking on checkbox:

enter image description here

After:

enter image description here

I want to completly disable horizontal autoscroll...

Panel is Anchored: top,left,right,bot Code for setting the autoscroll:

 PANEL.AutoScroll = false;
 PANEL.HorizontalScroll.Enabled = false;
 PANEL.HorizontalScroll.Visible = false;
 PANEL.HorizontalScroll.Maximum = 0;
 PANEL.AutoScroll = true;

THANKS FOR ANY HELP

Upvotes: 0

Views: 196

Answers (1)

Michael de Vlieger
Michael de Vlieger

Reputation: 88

Try to dock your panel first to the form.

Upvotes: -1

Related Questions