>Hi,
>
>Thank a lot for your help, however,
>the code
>
>>.grid1.column3.dynamicbackcolor = thisform.SetImage() < give me error of
>setimage is not found
>
>
>*thisform.SetImage
>>this.grid1.column3.image1.picture = test.Image_filename <
>
>The above code just keep displaying the same picture
>on all column3 of my grid. My column3 should show me different
>picture as store in my test dbf file image_filename field.
>Please advise and help.
>
>
>
>>>Hi,
>>>
>>>I want to allow the display of image inside my grid control.
>>>However, setting the the below code, still cause my grid to
>>>display the same image. How do I set it to display the individual
>>>image from my test.dbf file image_filename field.
>>>
>>>WITH THISFORM
>>>
>>> grid1.column1.controlsource = 'test'
>>> grid1.column1.controltype = 0
>>>
>>> grid3.column3.sparse = .F.
>>> grid1.column3.currentcontrol = 'image1'
>>> grid1.column3.image1.picture = test->Image_filename
>>>
>>>ENDWITH
>>>
>>>Please advise as I can't set the displaying of image correctly.
>>>Thank you.
>>
>>.grid1.column3.dynamicbackcolor = thisform.SetImage()
>>
>>*thisform.SetImage
>>this.grid1.column3.image1.picture = test.Image_filename
>>return 0 && return a dummy color that won't be used at all
>>
>>Cetin
Try this sample pointing to a dir where all files are bitmaps (ie: bitmaps dir - I didn't include a check if it's a picture file) :
lcPath = getdir()
lnFiles = adir(aImageList, lcPath+'*.*')
Create cursor myImageList (FileName m)
For ix=1 to alen(aImageList,1)
Insert into myImageList values (lcPath+aImageList[ix,1])
Endfor
Go top
oForm = createobject('myForm')
With oForm
.Lockscreen = .t.
.Height = 400
.Width = 600
.Addobject('myGrid','Grid')
.Addobject('clbutton','closebutton')
.clbutton.visible = .t.
With .myGrid
.Left = 0
.Top = 20
.Height = 370
.Width = 590
.Columncount = -1
.Recordsource = 'myImageList'
.Columncount = 2
.RowHeight = .RowHeight * 7
With .Columns(2)
.Addobject('myContainer','Container')
.CurrentControl = 'myContainer'
.Sparse = .f.
With .myContainer
.Addobject('myImage','Image')
.myImage.Visible = .t.
Endwith
.Dynamicbackcolor = 'thisform.fake()'
Endwith
.Visible = .t.
Endwith
.Lockscreen = .f.
Endwith
oForm.Show
Read events
Define class myForm as Form
Procedure fake
Thisform.myGrid.Columns(2).myContainer.myImage.Picture = myImageList.FileName
Return thisform.myGrid.Backcolor
Endproc
Enddefine
Define class CloseButton as commandbutton
Height = 15
Caption ='close'
Procedure click
Clear events
Thisform.release
Endproc
Enddefine
Cetin