<tx***********@yahoo.com> wrote in message
news:lc********************************@4ax.com...
Is there a way in vb.net to determine the number of rows that can be
visible in the listview region ? Not the total # rows in the
listview, but only the visible count.
Also, I was wondering if there was a way to determine from a given
ListViewItem, whether or not it is currently visible in the region.
Public Const LVM_FIRST As Integer = &H1000
Public Const LVM_GETCOUNTPERPAGE As Integer = LVM_FIRST + 40
Public Const WM_SETREDRAW As Integer = &HB
Public Enum LVS_EX
LVS_EX_GRIDLINES = &H1
LVS_EX_SUBITEMIMAGES = &H2
LVS_EX_CHECKBOXES = &H4
LVS_EX_TRACKSELECT = &H8
LVS_EX_HEADERDRAGDROP = &H10
LVS_EX_FULLROWSELECT = &H20
LVS_EX_ONECLICKACTIVATE = &H40
LVS_EX_TWOCLICKACTIVATE = &H80
LVS_EX_FLATSB = &H100
LVS_EX_REGIONAL = &H200
LVS_EX_INFOTIP = &H400
LVS_EX_UNDERLINEHOT = &H800
LVS_EX_UNDERLINECOLD = &H1000
LVS_EX_MULTIWORKAREAS = &H2000
LVS_EX_LABELTIP = &H4000
LVS_EX_BORDERSELECT = &H8000
LVS_EX_DOUBLEBUFFER = &H10000
LVS_EX_HIDELABELS = &H20000
LVS_EX_SINGLEROW = &H40000
LVS_EX_SNAPTOGRID = &H80000
LVS_EX_SIMPLESELECT = &H100000
End Enum 'LVS_EX
Public Enum LVM
LVM_FIRST = &H1000
LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54
LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55
End Enum 'LVM
Public Overloads Declare Auto Function SendMessage Lib "User32.dll"
(ByVal hwnd As IntPtr, ByVal msg As Integer, ByVal wParam As Integer, ByVal
lParam As Integer) As Integer
Private Function GetVisibleItemsCount(ByRef listView As ListView) As
Integer
Dim visibleCount As Integer = SendMessage(listView.Handle,
LVM_GETCOUNTPERPAGE, 0, 0)
Return (visibleCount)
End Function
Bartol
--
Remove "TB" from address to reply