还有,数据多的时候,1000多行,显示速度很慢,请问如何提高。代码如下: 'msgURight 就是 msflexgrid 控件 Rst.Open sql, Conn, 1 If Not Rst.EOF Then 'F.msgURight.Rows = F.msgURight.Rows + Rst.RecordCount 'F.msgGRight.DataSource= Do While Not Rst.EOF F.msgURight.Rows = F.msgURight.Rows + 1 Row = Row + 1 F.msgURight.RowHeight(Row - 1) = 300 With F.msgURight .Row = Row - 1 .Col = 0 .CellForeColor = &HFF& .Text = Trim(Rst.Fields(1).Value) .RowData(Row - 1) = Rst.Fields(0).Value End With
If IsNull(Rst.Fields("rightvalue").Value) Then 'È¡µÃµ±Ç°À¸Ä¿µÄȨÏÞÖµ£¡ TempRV = 0 Else TempRV = CInt(Rst.Fields("rightvalue").Value) End If
If (TempRV And 128) = 128 Then With F.msgURight .Row = Row - 1 .Col = 1 .CellPictureAlignment = 4 Set .CellPicture = F.ilsgrd.ListImages(1).Picture End With End If If (TempRV And 64) = 64 Then With F.msgURight .Row = Row - 1 .Col = 2 .CellPictureAlignment = 4 Set .CellPicture = F.ilsgrd.ListImages(1).Picture End With End If For TempI = 0 To Col - 4 '¼ÆËãÆäËûȨÏÞ If (TempRV And 2 ^ TempI) = 2 ^ TempI Then With F.msgURight .Row = Row - 1 .Col = TempI + 3 .CellPictureAlignment = 4 Set .CellPicture = F.ilsgrd.ListImages(1).Picture End With End If Next
F.msgURight.TextMatrix(Row - 1, 0) = Trim(Rst.Fields(1).Value) Rst.MoveNext Loop End If Rst.Close借楼主的地方问,谢谢。
借搂主的地方问了个问题,谢谢
Rst.Open sql, Conn, 1
If Not Rst.EOF Then
'F.msgURight.Rows = F.msgURight.Rows + Rst.RecordCount
'F.msgGRight.DataSource=
Do While Not Rst.EOF
F.msgURight.Rows = F.msgURight.Rows + 1
Row = Row + 1
F.msgURight.RowHeight(Row - 1) = 300
With F.msgURight
.Row = Row - 1
.Col = 0
.CellForeColor = &HFF&
.Text = Trim(Rst.Fields(1).Value)
.RowData(Row - 1) = Rst.Fields(0).Value
End With
If IsNull(Rst.Fields("rightvalue").Value) Then 'È¡µÃµ±Ç°À¸Ä¿µÄȨÏÞÖµ£¡
TempRV = 0
Else
TempRV = CInt(Rst.Fields("rightvalue").Value)
End If
If (TempRV And 128) = 128 Then
With F.msgURight
.Row = Row - 1
.Col = 1
.CellPictureAlignment = 4
Set .CellPicture = F.ilsgrd.ListImages(1).Picture
End With
End If
If (TempRV And 64) = 64 Then
With F.msgURight
.Row = Row - 1
.Col = 2
.CellPictureAlignment = 4
Set .CellPicture = F.ilsgrd.ListImages(1).Picture
End With
End If
For TempI = 0 To Col - 4 '¼ÆËãÆäËûȨÏÞ
If (TempRV And 2 ^ TempI) = 2 ^ TempI Then
With F.msgURight
.Row = Row - 1
.Col = TempI + 3
.CellPictureAlignment = 4
Set .CellPicture = F.ilsgrd.ListImages(1).Picture
End With
End If
Next
F.msgURight.TextMatrix(Row - 1, 0) = Trim(Rst.Fields(1).Value)
Rst.MoveNext
Loop
End If
Rst.Close借楼主的地方问,谢谢。