Tools Links Login

Auto Scroll ListBox/MSFlexGrid

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

Original Author: Stephen Lim

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
'Constant
Const WM_VSCROLL = &H115
Const SB_BOTTOM = 7

Code

'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

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 109 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.