<tx***********@ yahoo.com> wrote in message
news:lc******** *************** *********@4ax.c om...
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_GETCOUNTPER PAGE As Integer = LVM_FIRST + 40
Public Const WM_SETREDRAW As Integer = &HB
Public Enum LVS_EX
LVS_EX_GRIDLINE S = &H1
LVS_EX_SUBITEMI MAGES = &H2
LVS_EX_CHECKBOX ES = &H4
LVS_EX_TRACKSEL ECT = &H8
LVS_EX_HEADERDR AGDROP = &H10
LVS_EX_FULLROWS ELECT = &H20
LVS_EX_ONECLICK ACTIVATE = &H40
LVS_EX_TWOCLICK ACTIVATE = &H80
LVS_EX_FLATSB = &H100
LVS_EX_REGIONAL = &H200
LVS_EX_INFOTIP = &H400
LVS_EX_UNDERLIN EHOT = &H800
LVS_EX_UNDERLIN ECOLD = &H1000
LVS_EX_MULTIWOR KAREAS = &H2000
LVS_EX_LABELTIP = &H4000
LVS_EX_BORDERSE LECT = &H8000
LVS_EX_DOUBLEBU FFER = &H10000
LVS_EX_HIDELABE LS = &H20000
LVS_EX_SINGLERO W = &H40000
LVS_EX_SNAPTOGR ID = &H80000
LVS_EX_SIMPLESE LECT = &H100000
End Enum 'LVS_EX
Public Enum LVM
LVM_FIRST = &H1000
LVM_SETEXTENDED LISTVIEWSTYLE = LVM_FIRST + 54
LVM_GETEXTENDED LISTVIEWSTYLE = 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 GetVisibleItems Count(ByRef listView As ListView) As
Integer
Dim visibleCount As Integer = SendMessage(lis tView.Handle,
LVM_GETCOUNTPER PAGE, 0, 0)
Return (visibleCount)
End Function
Bartol
--
Remove "TB" from address to reply