C# 检查TreeView滚动条的可见性
如何检查树视图中的垂直滚动条是否可见?必须执行一些p/invoke操作才能获得树视图的样式C# 检查TreeView滚动条的可见性,c#,winforms,treeview,scrollbar,C#,Winforms,Treeview,Scrollbar,如何检查树视图中的垂直滚动条是否可见?必须执行一些p/invoke操作才能获得树视图的样式 private const int GWL_STYLE = -16; private const int WS_VSCROLL = 0x00200000; [DllImport("user32.dll", ExactSpelling = false, CharSet = CharSet.Auto)] private static extern int GetWindowLo
private const int GWL_STYLE = -16;
private const int WS_VSCROLL = 0x00200000;
[DllImport("user32.dll", ExactSpelling = false, CharSet = CharSet.Auto)]
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
bool VScrollVisible()
{
int style = GetWindowLong(myTreeView.Handle, GWL_STYLE);
return ((style & WS_VSCROLL) != 0);
}
添加更多详细信息,您尝试了什么,您的原始格式是什么,代码。注意:GetWindowLong对于32位和64位执行是不同的。有关此问题的解决方案,请参见此处: