Is there anyway to get the number of lines that are visible in an MSHFlexgrid?
I need to go thru the data that is on the screen at present time and need to know the total number of visible lines.
Printable View
Is there anyway to get the number of lines that are visible in an MSHFlexgrid?
I need to go thru the data that is on the screen at present time and need to know the total number of visible lines.
If you are talkning about the number of visible rows, then you can loop through the rows like this:
I just whipped this up quickly. Hope it helps. Once you get the value of j where the first row that isn't visible occurs, you can work from there.:wave:
Code:Dim isvisible As Boolean
With MSHFlexGrid1
.Rows = 20
.Cols = 2
For j = 1 To MSHFlexGrid1.Rows - 1
isvisible = .RowIsVisible(j)
If isvisible = False Then
MsgBox j
Exit For
End If
Next j
End With
Thanks,
Here's what i have come up with
vb Code:
Private Function GetVisibleRows(msh As MSHFlexGrid) As Long Dim i As Long Dim Count As Long With msh For i = .TopRow To .Rows - 1 If .RowIsVisible(i) Then Count = Count + 1 Else Exit For End If Next i End With GetVisibleRows = Count
my pleasure. I'm glad I could help. You have helped me many many times in the past:thumb: