| {\rtf1\ansi\ansicpg1252\deff0\deflang1044{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 Enter this into the General Declarations of a form or module: \par \par 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 \par Private Const LB_GETTOPINDEX = &H18E \par \par \par Add this to the same form or module: \par \par Public Property Get FirstVisibleListItem(m_lstBox As ListBox) As Long \par FirstVisibleListItem = SendMessage(lstBox.hwnd, LB_GETTOPINDEX, &O0, &O0) \par End Property \par \par \par To find the first visible item in a list box use: \par \par MsgBox FirstVisibleListItem(myListBox) \par } |
Finding the first visible item in List Box |
India web developer web development India | India web development company India ecommerce web developer