J
Jesper, Denmark
Hi,
Is there a way to detect whenever scrollbars (the vertical) are shown on a
treeview
I need to know.
1) If scrollbars are visible after a rezise
2) If scrollbars are visible after change in content (e.g. nodes
collapsed/expanded, nodes added/deleted ). Any event to hook into?
I found something to solve (1) in VB6.0 (see below) but dont know how to
translate this into .net.
Dim wndStyle As Long
' Retrieve the window style of the control.
wndStyle = GetWindowLong(TreeView1.hwnd, GWL_STYLE)
' Test if the horizontal scroll bar style is present
' in the window style, indicating that a horizontal
' scroll bar is visible.
If (wndStyle And WS_HSCROLL) <> 0 Then
MsgBox "A horizontal scroll bar is visible."
Else
MsgBox "A horizontal scroll bar is NOT visible."
End If
' Test if the vertical scroll bar style is present
' in the window style, indicating that a vertical
' scroll bar is visible.
If (wndStyle And WS_VSCROLL) <> 0 Then
MsgBox "A vertical scroll bar is visible."
Else
MsgBox "A vertical scroll bar is NOT visible."
End If
Is there a way to detect whenever scrollbars (the vertical) are shown on a
treeview
I need to know.
1) If scrollbars are visible after a rezise
2) If scrollbars are visible after change in content (e.g. nodes
collapsed/expanded, nodes added/deleted ). Any event to hook into?
I found something to solve (1) in VB6.0 (see below) but dont know how to
translate this into .net.
Dim wndStyle As Long
' Retrieve the window style of the control.
wndStyle = GetWindowLong(TreeView1.hwnd, GWL_STYLE)
' Test if the horizontal scroll bar style is present
' in the window style, indicating that a horizontal
' scroll bar is visible.
If (wndStyle And WS_HSCROLL) <> 0 Then
MsgBox "A horizontal scroll bar is visible."
Else
MsgBox "A horizontal scroll bar is NOT visible."
End If
' Test if the vertical scroll bar style is present
' in the window style, indicating that a vertical
' scroll bar is visible.
If (wndStyle And WS_VSCROLL) <> 0 Then
MsgBox "A vertical scroll bar is visible."
Else
MsgBox "A vertical scroll bar is NOT visible."
End If