|
-
Jan 5th, 2002, 08:07 PM
#1
Thread Starter
Stuck in the 80s
ListView
How to make a ListView scroll...why doesn't this work?
VB Code:
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
Const SB_LINEDOWN = 1
Const SB_LINEUP = 0
Const SB_PAGEDOWN = 3
Const WM_VSCROLL = &H2E
Private Sub Command1_Click()
SendMessage ListView1.hwnd, WM_VSCROLL, SB_LINEDOWN, 0&
End Sub
-
Jan 5th, 2002, 10:18 PM
#2
Frenzied Member
This code works for me...
VB Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Private Sub Form_Click()
' Send a WM_VSCROLL message 0 is up and 1 is down
' SendMessage tvwFTPDir.hWnd, 277&, 0&, vbNull
SendMessage ListView1.hWnd, 277&, 1&, vbNull
End Sub
Private Sub Form_Load()
Dim k As Integer
ListView1.View = lvwReport
ListView1.ColumnHeaders.Add , , "test"
For k = 1 To 20
ListView1.ListItems.Add , , Str$(k)
Next
End Sub
Greg
Free VB Add-In - The Reference Librarian
Click Here for screen shot and download link.
-
Jan 5th, 2002, 11:41 PM
#3
Thread Starter
Stuck in the 80s
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|