|
-
November 27th, 2001, 06:50 AM
#1
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
-
November 28th, 2001, 07:51 AM
#2
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
-
November 28th, 2001, 07:56 AM
#3
Re: MS Grid Control
thanks, you are right
Valery Iskarov Nikolov
Software Dynamics
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|