各位辛苦了,目前,我做一个程序,用到msflexgrid 控件!
msflexgrid显示数据库内的数据,但是,我操错数据库的时候需要数据Id,请问,如何设置某个单元格显示数据,但隐含数据ID,比如:
  with msflexgrid1
    .col=0
    .row=0
    .text="我"
    .tag="25"
  end with问题就是我这么设置,那个.tag不起作用,我引用的时候,是这样用的dim dataid as string
dim data as string  width msflexgrid1
    .col=0
    .row=0
    data=.text
    dataid=.tag
  end with  msgbox data  '显示正确 “我”
  msgbox dataid  '显示错误,是一个数字,好像是行数-1请问,如何使.tag 生效?

解决方案 »

  1.   

    嘿嘿,msflexgrid没有单元对象的,因此没有单元格Tag
    不过,有个RowData,那是每行都有的数据,是Long型。可以用来保存ID。
    with msflexgrid1
        .col=0
        .row=0
        .text="我"
        .RowData(0)=25
     end with  width msflexgrid1
        .col=0
        .row=0
        data=.text
        dataid=.rowdata(0)
      end with
      

  2.   

    谢谢二楼的,不过,好像还是不行,我分别给5行的 .rowdata(0) 赋了不同的值,结果,这五行数据的
    .rowdata(0) 都变成相同的数据5 了?
      

  3.   

    二楼的高人是不是说:.rowdata(0)  与第一行有关,.rowdata(1) 与第二行有关?