MSFlexGrid load ICO

10-22-2004, 09:54 AM
I have the following code.
there is a file that holds some values that need to be imported in an MSFlexGrid. This works fine.
However, I would like to display an icon or otherwise picture in a particular cell, in those rows where a sequence is true.
I tried loading the picture (hardcode) and imagelists.
the problem is
The icon is displayed only in the first row that meets my needs and it is also displayed bigger that it should be.
the ico is 16x16, i have loaded it in an image control and works fine.
the same result came when trying to load a jpg.
any ideas ?
ps: there is a line in comments which places a string ("icon") where the icon should be. when I use the text it works ok and the "icon" is displayed where it should be. the same procedure for an icon does not function.

thanxs in advance!

With MSFlexGrid1
Open CommonDialog1.FileName For Input As #2
i = 0
Do Until EOF(2)

Line Input #2, getline

.Rows = .Rows + 1

'getline holds each line
'now process it
ReDim cellitems(5)
cellitems = Split(getline, ",")

If cellitems(4) = "no" Then
'.TextMatrix(i, 0) = "icon"
Set .CellPicture = ImageList1.ListImages(2).Picture

End If

For k = 1 To .Cols - 1
.TextMatrix(i, k) = cellitems(k - 1)

i = i + 1

.Rows = .Rows - 1
Close #2
End With

10-22-2004, 10:02 AM
sorry I think I have found it.
it was easy but the late hours u see....
I should have used :

.Row = i
.Col = 0

...before setting the image!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum