怎么在MsFlexGrid里显示出每一行的标识1,2,3等,是自动生成的那种,谢谢,求源代码!

解决方案 »

  1.   

    Private Sub Form_Load()
        Dim I As Integer
        With MSFlexGrid1
            .Clear
            .Cols = 3
            .Rows = 10
            For I = 0 To 9
                .TextMatrix(I, 0) = I + 1
            Next
        End With
    End Sub不知这样算不算自动的了。^_^
      

  2.   

    Private Sub Form_Load()
    dim i as integer
    With mshflexgrid1(6)
       .Rows = 151
    For i = 1 To 150
       .TextArray(Fgi6(i, 0)) = i
    Next
    end with
    end subFunction Fgi(r As Integer, c As Integer) As Integer
    Fgi = c + mshflexgrid1.Cols * r
    End Function
      

  3.   

    是啊,要什么样的答案?
    Private Sub MSFlexGrid_Show()
        Dim i As Integer
        With MSFlexGrid1
            .Cols = 7
            .ColWidth(0) = 800
            .TextMatrix(0, 0) = "序号"
            .ColWidth(1) = 2800
            .TextMatrix(0, 1) = "条码"
            .ColWidth(2) = 5200
            .TextMatrix(0, 2) = "名称"
            ......        
            For i = 1 To .Rows - 1
                .TextMatrix(i, 0) = i
            Next i
        End With
    End Sub
      

  4.   

    请问具体的在前面
    msglist.TextMatrix(0,0)让他自动编号 和
    让列表每各一行显示不同的颜色我该怎么办呢??求源代码!谢谢!
      

  5.   

    编号还可以从sql语句中实现,颜色只能自己一行一行写了,不如都重新写一遍
    .CellBackColor :当前单元格背景色
      

  6.   

    用存储过程好吧?
    把当前记录插到临时表,建一个Indentity字段,然后Select *
      

  7.   

    一定要用msglist.Redraw=false,要不然行数多起来慢得要死
      

  8.   

    用下面的语句可以自动获得编号:
    select * into #tmptabel from 你的表                                插入到临时表
    alter table #tmptabel add 你的编号列名 [bigint] IDENTITY (1, 1)    插入临时表自动编号列
    select * from #tmptabel                                            获取记录
    记得用完后关闭