vb中ListBox怎么加左右滚动条ScrollBar
展开全部
参姿旦裂考如下:
Private
Sub
Form_Load()
Dim
Information#,
Scrollbar#
For
Information
=
1
To
88
List1.AddItem
_
"横滚动条示范"
&
_
"横滚动迟胡条示范"
&
_
"横滚动条示范迹闭"
Next
Information
Information
=
SendMessageLong(List1.hwnd,
LB_SETHORIZONTALEXTENT,
2000,
0)
'2000:控制横滚动条的范围(建议值2000-3000)
Scrollbar
=
GetWindowLong(List1.hwnd,
GWL_STYLE)
Scrollbar
=
Scrollbar
Or
WS_HSCROLL
SetWindowLong
List1.hwnd,
GWL_STYLE,
Scrollbar
SetWindowPos
List1.hwnd,
_
0,
0,
0,
0,
0,
_
SWP_NOMOVE
Or
SWP_NOOWNERZORDER
Or
SWP_NOSIZE
Or
SWP_FRAMECHANGED
End
Sub
Private
Sub
Form_Load()
Dim
Information#,
Scrollbar#
For
Information
=
1
To
88
List1.AddItem
_
"横滚动条示范"
&
_
"横滚动迟胡条示范"
&
_
"横滚动条示范迹闭"
Next
Information
Information
=
SendMessageLong(List1.hwnd,
LB_SETHORIZONTALEXTENT,
2000,
0)
'2000:控制横滚动条的范围(建议值2000-3000)
Scrollbar
=
GetWindowLong(List1.hwnd,
GWL_STYLE)
Scrollbar
=
Scrollbar
Or
WS_HSCROLL
SetWindowLong
List1.hwnd,
GWL_STYLE,
Scrollbar
SetWindowPos
List1.hwnd,
_
0,
0,
0,
0,
0,
_
SWP_NOMOVE
Or
SWP_NOOWNERZORDER
Or
SWP_NOSIZE
Or
SWP_FRAMECHANGED
End
Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询