当前位置: 代码迷 >> PB >> treeview会去掉横向的滚动条么
  详细解决方案

treeview会去掉横向的滚动条么

热度:52   发布时间:2016-04-29 06:12:58.0
treeview能去掉横向的滚动条么
没有发现treeview有设置滚动条的属性,我想把横向滚动条给去了,不知道哟什么方法没?
------解决方案--------------------
还有一种方法,也是API:

定义两个实例常量 
constant   int   GWL_STYLE         =   -16 
constant   uLONG   TVS_NOHSCROLL   =   32768 

定义两个外部函数声明 
Function   long   GetWindowLong   (ulong   hWnd,   int   nIndex)   Library   "USER32.DLL "     Alias   for   "GetWindowLongA " 
Function   long   SetWindowLong   (ulong   hWnd,   int   nIndex,   long   dwNewLong)   Library   "USER32.DLL "   Alias   for   "SetWindowLongA " 

在程序中按照以下方法写 
long   ll_TVStyle 
ll_TVStyle   =   GetWindowLong(Handle(tv_1),GWL_STYLE) 
ll_TVStyle   +=   TVS_NOHSCROLL 
SetWindowLong(Handle(tv_1),GWL_STYLE,ll_TVStyle) 
  相关解决方案