如何使用不带滚动条的按钮在VB.NET中向下滚动

问题描述:

我想知道如何在VB.NET中使用按钮向下滚动包含TabControlPanel,而不显示滚动条。我试过以下如何使用不带滚动条的按钮在VB.NET中向下滚动

Dim Location As Integer = Panel_Images.Location.Y 

If Location + 20 < Panel_Images.VerticalScroll.Maximum Then 

    Location += 20 
    Panel_Images.VerticalScroll.Value = Location 

Else 

    'If scroll position is above 280 set the position to 280 (MAX) 
    Location = Panel_Images.VerticalScroll.Maximum 
    Panel_Images.AutoScrollPosition = New Point(0, Location) 
End If 

它只滚动一次,并不再工作。

所以你想设置面板的位置在另一个控制?如果您想要向上滚动控件,请将它的location.Y(或其'Top')属性设置为减去所需的任何值,它将由其父项剪切。

要向下滚动,请将属性设置为正值。