MSFlexGrid 使用


Private Sub SetGridTitle()
   With flexGrid
      .FormatString = "流水号|录入时间|赔案号|保单号|被保险人|厂牌型号|保险类型|牌照号码|使用性质|业务部门|业务员|理赔员|立案日期|合计"
     
      .ColAlignment(0) = flexAlignLeftCenter
      .ColAlignment(1) = flexAlignLeftCenter
      .ColAlignment(2) = flexAlignLeftCenter
      .ColAlignment(3) = flexAlignLeftCenter
      .ColAlignment(4) = flexAlignLeftCenter
      .ColAlignment(5) = flexAlignLeftCenter
      .ColAlignment(6) = flexAlignLeftCenter
      .ColAlignment(7) = flexAlignLeftCenter
      .ColAlignment(8) = flexAlignLeftCenter
      .ColAlignment(9) = flexAlignLeftCenter
      .ColAlignment(10) = flexAlignLeftCenter
      .ColAlignment(11) = flexAlignLeftCenter
      .ColAlignment(12) = flexAlignLeftCenter
      .ColAlignment(13) = flexAlignLeftCenter
      .TextStyleFixed = flexTextInsetLight
   End With
End Sub
------------------------------------------------
sqltxt = "select * from useb"
rs.Open sqltxt, cnn, adOpenKeyset, adLockBatchOptimistic
If rs.EOF Then
MsgBox ("暂无用户")
MSFlexGrid1.Rows = 0
MSFlexGrid1.Cols = 0
Else
With MSFlexGrid1
.Rows = rs.RecordCount + 1
.Cols = rs.Fields.Count
For i = 0 To rs.Fields.Count - 1
.TextMatrix(0, i) = rs.Fields(i).Name
Next i
For t = 1 To rs.RecordCount

For i = 0 To rs.Fields.Count - 1
.TextMatrix(t, i) = rs.Fields(i)
Next i
rs.MoveNext
Next t
End With
End If

 

posted on 2005-06-16 09:28  大志  阅读(2275)  评论(0编辑  收藏  举报