C# UserControl.VerticalScroll.Value not being set

后端 未结 4 1414
野趣味
野趣味 2020-12-20 21:00

I\'ve got a chunk of C# code that is supposed to set VerticalScroll.Value within a class that inherits from UserControl. It gets called when any child object of the class c

4条回答
  •  一整个雨季
    2020-12-20 21:31

    In my case it was necessary to set the VerticalScroll.Value to a different value and then to the value of interest, e.g.

    this.panel1.VerticalScroll.Value = verticalScrollPosition - 1;
    this.panel1.VerticalScroll.Value = verticalScrollPosition;   
    

    Take care that the scroll position is always between VerticalScroll.Minimum and VerticalScroll.Maximum.

提交回复
热议问题