-
May 21st, 2013, 10:29 AM
#1
Determine if a DataGridView's horizontal scroll bar exists?
Visual Basic 2010, .NET 3.5 Is there a way to pragmatically determine if a DataGridView's horizontal scroll bar is active or visible? I need to move a few items about when the DGV's horizontal scroll bar comes on
-
May 21st, 2013, 04:25 PM
#2
Re: Determine if a DataGridView's horizontal scroll bar exists?
I played around with this and figured out how to determine if a scroll bar is visible, a horizontal scroll bar in the example below.
Code:
Private Function HScrollBarVisible() As Boolean
Dim ctrl As New Control
For Each ctrl In DataGridView1.Controls
If ctrl.GetType() Is GetType(HScrollBar) Then
If ctrl.Visible = True Then
Return True
Else
Return False
End If
End If
Next
Return Nothing
End Function
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|