VBcoders Guest

Don't have an account yet? Register

Forgot Password?

Auto Scroll ListBox/MSFlexGrid

by milevets (1 Submission)
Category: Windows API Call/Explanation
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (7 Votes)

Ever wanted to automatically scroll (vertical) ListBox or MSFlexGrid? Below is a quick solution and it's especially handy when you cannot use object.TopRow (due to variable row height, etc).
Happy Coding

API Declarations
'Import Win32 API function
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 WM_VSCROLL = &H115
Const SB_BOTTOM = 7

Rate Auto Scroll ListBox/MSFlexGrid

'Call below where auto scroll is intended
SendMessage MSFG.hwnd, WM_VSCROLL, SB_BOTTOM, 0
'MSFG is my FlexGrid control, can be changed to ListBox

Download this snippet    Add to My Saved Code

Auto Scroll ListBox/MSFlexGrid Comments

No comments have been posted about Auto Scroll ListBox/MSFlexGrid. Why not be the first to post a comment about Auto Scroll ListBox/MSFlexGrid.

Post your comment

0/1000 characters