CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2001
    Posts
    254

    mflexgrid top row

    I'am using msflexgrid to display records from my table, after it display all, how can I set to display from the first record

    thanks
    cyrus

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: mflexgrid top row

    Hint: Set the REDRAW to FALSE while you're drawing the table, and it will load quicker.

    Code:
    Option Explicit
    
    Private Sub Command1_Click()
    Dim i As Integer
    flx.Redraw = False
    For i = 1 To flx.Rows - 1
      If i Mod 2 = 0 Then
        With flx
          .FillStyle = flexFillRepeat
          .Row = i
          .RowSel = i
          .Col = 1
          .ColSel = .Cols - 1
          .CellBackColor = vbRed
          .CellForeColor = vbWhite
        End With
      End If
      Next i
    flx.Redraw = True
    flx.Row = 1
    End Sub
    
    Private Sub Form_Load()
      Dim i As Integer, j As Integer
      With flx
       For i = 1 To flx.Rows - 1
          For j = 0 To .Cols - 1
            .TextMatrix(i, j) = i & ", " & j
          Next j
      Next i
      End With
    End Sub
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

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

Featured