VB6.0给ListBox加横向滚动条
程序代码: | [ 复制代码到剪贴板 ] |
Option Explicit
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Private Const LB_SETHORIZONTALEXTENT = &H194
Private Sub Command1_Click()
addHorScrlBarListBox List1
End Sub
Public Sub addHorScrlBarListBox(ByVal refControlListBox As Object)
' 加横向滚动条
Dim nRet As Long
Dim nNewWidth As Integer
nNewWidth = refControlListBox.Width + 100 ' 新宽度,以像素为单位。
nRet = SendMessage(refControlListBox.hwnd, _
LB_SETHORIZONTALEXTENT, nNewWidth, ByVal 0&)
End Sub
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Private Const LB_SETHORIZONTALEXTENT = &H194
Private Sub Command1_Click()
addHorScrlBarListBox List1
End Sub
Public Sub addHorScrlBarListBox(ByVal refControlListBox As Object)
' 加横向滚动条
Dim nRet As Long
Dim nNewWidth As Integer
nNewWidth = refControlListBox.Width + 100 ' 新宽度,以像素为单位。
nRet = SendMessage(refControlListBox.hwnd, _
LB_SETHORIZONTALEXTENT, nNewWidth, ByVal 0&)
End Sub
[本日志由 田草 于 2007-11-29 09:53 AM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |