亲啊,快帮我看看一下vb中的代码吧?急需答案,谢谢了
PublicSubTweGridScale(vgAsVSFlex7Ctl.VSFlexGrid,VSgridAsMSDataGridLib.DataGrid)DimjAs...
Public Sub TweGridScale(vg As VSFlex7Ctl.VSFlexGrid, VSgrid As MSDataGridLib.DataGrid)
Dim j As Integer
For j = 1 To VSgrid.Columns.Count
vg.AutoSize j
Next
For j = 0 To VSgrid.Columns.Count - 1
VSgrid.Columns(j).Width = vg.ColWidth(j + 1)
Next
End Sub
Public Sub WriteVSGrid(AdoRS As ADODB.Recordset, vg As VSFlex7Ctl.VSFlexGrid)
On Error Resume Next
vg.Cols = AdoRS.Fields.Count + 1
vg.Rows = AdoRS.RecordCount + 1
vg.Clear
Dim i As Integer, j As Integer
For j = 0 To AdoRS.Fields.Count - 1
vg.TextMatrix(0, j + 1) = AdoRS.Fields(j).Name
Next
i = 1
Do While Not AdoRS.EOF '循环数据
For j = 0 To AdoRS.Fields.Count - 1
vg.TextMatrix(i, j + 1) = AdoRS.Fields(j)
Next
i = i + 1
AdoRS.MoveNext
Loop
'ORIGRIDScale vg
End Sub 展开
Dim j As Integer
For j = 1 To VSgrid.Columns.Count
vg.AutoSize j
Next
For j = 0 To VSgrid.Columns.Count - 1
VSgrid.Columns(j).Width = vg.ColWidth(j + 1)
Next
End Sub
Public Sub WriteVSGrid(AdoRS As ADODB.Recordset, vg As VSFlex7Ctl.VSFlexGrid)
On Error Resume Next
vg.Cols = AdoRS.Fields.Count + 1
vg.Rows = AdoRS.RecordCount + 1
vg.Clear
Dim i As Integer, j As Integer
For j = 0 To AdoRS.Fields.Count - 1
vg.TextMatrix(0, j + 1) = AdoRS.Fields(j).Name
Next
i = 1
Do While Not AdoRS.EOF '循环数据
For j = 0 To AdoRS.Fields.Count - 1
vg.TextMatrix(i, j + 1) = AdoRS.Fields(j)
Next
i = i + 1
AdoRS.MoveNext
Loop
'ORIGRIDScale vg
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询