Results 1 to 4 of 4

Thread: [RESOLVED] Visible line count in MSHFlexGrid

  1. #1

    Thread Starter
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Resolved [RESOLVED] Visible line count in MSHFlexGrid

    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.

  2. #2
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: Visible line count in MSHFlexGrid

    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.

    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

  3. #3

    Thread Starter
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Visible line count in MSHFlexGrid

    Thanks,

    Here's what i have come up with
    vb Code:
    1. Private Function GetVisibleRows(msh As MSHFlexGrid) As Long
    2. Dim i As Long
    3. Dim Count As Long
    4.  
    5.  
    6.     With msh
    7.    
    8.         For i = .TopRow To .Rows - 1
    9.            
    10.             If .RowIsVisible(i) Then
    11.                 Count = Count + 1
    12.             Else
    13.                 Exit For
    14.             End If
    15.            
    16.         Next i
    17.        
    18.     End With
    19.    
    20.     GetVisibleRows = Count

  4. #4
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: [RESOLVED] Visible line count in MSHFlexGrid

    my pleasure. I'm glad I could help. You have helped me many many times in the past

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width