Results 1 to 3 of 3

Thread: MSFLEXGRID control (Please help)

  1. #1

    Thread Starter
    Hyperactive Member kourosh's Avatar
    Join Date
    Aug 1999
    Location
    Vancouver, British Columbia, Canada
    Posts
    256

    MSFEXGRID control (Fixed row problem)

    Hi, I am writing a loan calculator and I use </b>MSFLEXGRID<b> to store the results. If you have every used flexgrid you know that there is at least 1 fix row and 1 fix coloumn. Well like a database I want to put the title of each collumn in the fir row (Fix row) the reason I want to do that is because the fix row does not scroll down so the user can see what each column are for (Like a database). So i used
    msflexgrid1.additem "Payment", 0
    0 is the index.
    this code should store the string Payment in the first spot in the first row but unfortunatly I get an error (30001), which tell me that I can not use the additem method to store string in the first row. I can't find the error number in my help file. I thought maybe somebody know how to get over thie.

    [Edited by kourosh on 03-29-2000 at 10:58 PM]

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Here is some code that you can use to fill in the headings.
    Code:
        MyGrid.TextArray(faIndex(0, 0)) = "Link"
        MyGrid.TextArray(faIndex(0, 1)) = "Description"
        MyGrid.TextArray(faIndex(0, 2)) = "URL"
    
    ' And the faIndex function is coded as follows
    
    Function faIndex(row As Integer, col As Integer) As Long
        faIndex = row * MyGrid.Cols + col
    End Function

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Or you can use TextMatrix property, which is very easy to use.

    Syntax:
    MSFlexGrid.TextMatrix(Row, Column)

    This will give you the location of the cell. So, in you case you can do something like this:
    Code:
    With MSFlexGrid1
        .Cols = 3
        .TextMatrix(0, 0) = "Link"         'First Column
        .TextMatrix(0, 1) = "Description"  'Second Column
        .TextMatrix(0, 2) = "URL"          'Third Column
    End With

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