-
MS Grid Control
Hi,
I need to set picture in every cell of grid control with more than 200 cells by 200 rows.
However this process takes more time that bearable. Can anyone give me a suggestion how to speed this process.
here is how I do this
Grid.Redraw = false
Dim j as Integer
Dim i as Integer
for j = 0 to Grid.Cols - 1
for i = 0 to Grid.Rows - 1
Grid.Row = i
Grid.Col = j
Grid.CellPictureAlignment = flexAlignCenterCenter
set Grid.CellPicture = LoadResPicture(104, vbResIcon)
next
next
Grid.Redraw = true
Thanks
Valery Iskarov Nikolov
Software Dynamics
-
Re: MS Grid Control
Hai,
As you are loading the same picture to all cells, why do you load the picture every time? The following code will run more efficiently
Dim X as IPictureDisp
Grid.Redraw = false
Dim j as Integer
Dim i as Integer
set X = LoadResPicture(104, vbResIcon)
for j = 0 to Grid.Cols - 1
for i = 0 to Grid.Rows - 1
With Grid
.Row = i
.Col = j
.CellPictureAlignment = flexAlignCenterCenter
set .CellPicture = X
End With
next
next
Grid.Redraw = true
All the best.
Kishore
-
Re: MS Grid Control
thanks, you are right
Valery Iskarov Nikolov
Software Dynamics