Option ExplicitPrivate Sub cmdclear_Click()
flxgsample.Clear
End SubPrivate Sub cmddata_Click()
Dim intindex As Long
Dim intloop As Long
For intindex = 1 To 20
flxgsample.AddItem Empty
flxgsample.Row = flxgsample.Row - 1
flxgsample.Col = 0
flxgsample.Text = "DATA" & intindex
flxgsample.CellBackColor = &H80FFFF
For intloop = 1 To 6
flxgsample.Col = intloop
flxgsample.Text = Left(CStr(Rnd * intloop * intindex), 6)
Next intloop
Next intindex
End SubPrivate Sub cmdlni_Click()
Dim intindex As Long
flxgsample.Cols = 7
flxgsample.Rows = 2
For intindex = 0 To flxgsample.Cols - 1
flxgsample.ColWidth(intindex) = 1150
Next intindex
End SubPrivate Sub cmdload_Click()
Dim intindex As Long
'定位在第一行操作
flxgsample.Row = 0
flxgsample.Col = 0
flxgsample.RowHeight(0) = 400  '第一行单元格的高度
Set flxgsample.CellPicture = LoadPicture("D:\icon\Wizard.ico")
'加载图片信息到第一行第一列
For intindex = 1 To 4
flxgsample.Col = intindex
flxgsample.Text = "客户信息表"
flxgsample.CellBackColor = &HFFFF80
Next intindex
For intindex = 5 To 6
    flxgsample.Col = intindex
    flxgsample.Text = CStr(Date)
    flxgsample.CellBackColor = &HFFFF80
Next intindex
flxgsample.MergeCells = flexMergeFree   '单元格允许自由合并
flxgsample.MergeRow(0) = True '在第一行进行相邻的,相同文本的单元格合并
'定位在第二行进行操作
flxgsample.Row = 1
For intindex = 1 To 6
    flxgsample.Col = intindex
    flxgsample.Text = ""  '不能设置为空,否则不能进行合并
    flxgsample.CellBackColor = &HE0E0E0
    Next intindex
    
    flxgsample.MergeRow(1) = True
End SubPrivate Sub flxgsample_Click()
lblinfo.Caption = "列:" & flxgsample.Col & ";行;" & flxgsample.Row & "值:" & flxgsample.TextEnd Sub四个按扭,一个label这是什么问题呢?

解决方案 »

  1.   

    忘记了,还有一个msflexgrid控件
      

  2.   

    不是,是里面的数据不能在msflexgrid中显示,不能在格子里显示,只能显示在msflexgrid的标题格中
      

  3.   

    For intindex = 1 To 6
        flxgsample.Col = intindex
        flxgsample.Text = ""  '不能设置为空,否则不能进行合并
        flxgsample.CellBackColor = &HE0E0E0
        Next intindexflxgsample.Text = "":你不是全部都没有数据吗?