On 14-Aug-06, at 6:30 PM, Walter Purvis wrote:

 you're addressing the cell at row 0 and column 0 which is
 the first cell in the listbox no matter how many rows you add.

 To fill in the cells of the row you've just added with the
 cell's column index increment the column parameter.
    dim i as integer
    me.HasHeading=true

    me.heading(0)="Heading1"
    me.Heading(1)="heading2"

    me.addrow""

    for i = 0 to 20
      me.Cell(me.lastIndex,i)=str(i)
    next

 LastIndex is the index of the last row added to the listbox
 which is the one you've just added with me.addrow"".

Well, sure, but me.addrow is not inside the loop, so at the end of the day he's still only going to have one row in the listbox and at some point he's going to be addressing columns which don't exist, unless he has 20+ column;
i.e., at the end, he's setting column #20 -> me.cell(0,20) = 20

Yes, that gives you 1 row with 21 columns filled in a listbox with 21 columns. This will give you 21 rows(listbox is zero based) with the first 2 columns filled in.

  dim i as integer
  me.HasHeading=true
  me.ColumnCount = 2
  me.heading(0)="Heading1"
  me.Heading(1)="heading2"

  for i = 0 to 20
    me.addrow""
    me.Cell(me.lastIndex,0)= "Row " + str(i) + " in column 0"
    me.Cell(me.lastIndex,1)= "Row " + str(i) + " in column 1"
  next

See, and it's not even the end of the day yet. :D

Bill Johnson
:::::::: [EMAIL PROTECTED] :::::::


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to