How to Programmatically Scroll a Panel

后端 未结 7 2064
隐瞒了意图╮
隐瞒了意图╮ 2020-11-29 06:57

I have a System.Windows.Forms.Panel with some content.

I am trying to programmatically scroll the panel (vertically) either up or down.

I have t

7条回答
  •  生来不讨喜
    2020-11-29 07:24

    Use @King King Answered Code and if you want to hide horizontal and vertical scroll bar, just apply the below code in the constructor or initialization.

            yourPanel.AutoScroll = false;
            yourPanel.HorizontalScroll.Maximum = 0;
            yourPanel.HorizontalScroll.Visible = false;
            yourPanel.VerticalScroll.Maximum = 0;
            yourPanel.VerticalScroll.Visible = false;
            yourPanel.AutoScroll = true;
    

提交回复
热议问题