2013-03-26 1 views
1

TreeView의 세로 스크롤 막대가 보이는지 어떻게 확인할 수 있습니까?TreeView 검사 ScrollBar 가시성

+0

자세한 내용을 입력하십시오. 어떤 것을 시도 했습니까? 원래 양식, 코드는 무엇입니까? – Star

답변

5

TreeView의 스타일을 얻으려면 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 GetWindowLong(IntPtr hWnd, int nIndex); 

    bool VScrollVisible() 
    { 
     int style = GetWindowLong(myTreeView.Handle, GWL_STYLE); 
     return ((style & WS_VSCROLL) != 0); 
    }