How can I determine if a VB.NET ListView is displaying vertical scrollbar to user

后端 未结 2 867
你的背包
你的背包 2021-01-21 13:17

I feel like this should be something simple, but I can\'t seem to find out how to do this.

I have a list view control, and I would just like to be able to determine if t

2条回答
  •  一整个雨季
    2021-01-21 14:06

    Try this code, all .net, and only a 1 line function.

    Private Function IsVerticalScrollVisible(ByVal lst As ListView) As Boolean
        If lst.Items.Count > 0 Then _
            If (lst.Items(0).Bounds.Top - lst.TopItem.Bounds.Top < 0) Or _
            (lst.Items(lst.Items.Count - 1).Bounds.Bottom > lst.ClientSize.Height) _
            Then Return True
    End Function
    

提交回复
热议问题