DiverDan
Contributor
Hi,
I'm having a problem programmably increasing a panel's AutoScrollPosition. With the lower code, the auto scroll vibrates up and down instead of progressing constantly downward.
How can I have pnlPanel scroll constantly downward with bkrTemp?
Thanks,
Dan
I'm having a problem programmably increasing a panel's AutoScrollPosition. With the lower code, the auto scroll vibrates up and down instead of progressing constantly downward.
Visual Basic:
Private Sub bkrTemp_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles bkrTemp.MouseMove
Dim pt As Point
pt.X = Me.PointToClient(Cursor.Current.Position).X - x
pt.Y = Me.PointToClient(Cursor.Current.Position).Y - y
With bkrTemp
.Location = pt
.Capture = True
End With
If pnlPanel.AutoScroll = True Then
Dim bkrLocY As Integer = bkrTemp.Location.Y - (pnlPanel.Location.Y + pnlPanel.AutoScrollPosition.Y) + bkrTemp.Height
Dim pnlHeight As Integer = pnlPanel.Height - (pnlPanel.AutoScrollMargin.Height + 17)
If bkrLocY + 2 >= pnlHeight Then
pnlPanel.AutoScrollPosition = New Point(pnlPanel.AutoScrollPosition.X, pnlPanel.AutoScrollPosition.Y + 5)
End If
End If
End Sub
How can I have pnlPanel scroll constantly downward with bkrTemp?
Thanks,
Dan