I think you need to:
- based on mouse x/y, figure out which row of the grid mouse hovers
- from grid row number, retrieve Recno(myCursor)
- read mycursor.pict_name at this Recno()
- assign this value to image.picture
>Hi all:
>
>I have a grid on a form. One of the fields in the grid's recordsource contains the name of a picture file. The corresponding column in the grid is coded to display a Y/N based on whether or not a picture is associated with the record.
myform.mygrid.column1.controlsource = "IIF(EMPTY(mycursor.pict_name),'N','Y')"
>
>I've also put an image control on the form. This is usually set as invisible.
>
>What I would like to have happen is that as the mouse moves over each cell in the column the picture will display in the image control. Something like
>
IF NOT EMPTY(mycursor.pict_name)
> thisform.image1.picture = mycursor.pict_name
> thisform.image1.visible = .T.
>ELSE
> thisform.image1.visible = .F.
>ENDIF
>
>and then when the mouse leaves the cell
>
thisform.image1.visible = .F.
>
>The issue at the moment is where to put the code. I tried putting it in the column mouse enter/leave event, but that will only display the picture from the current record in the cursor. Moving the mouse from row to row doesn't trigger any record movment in the cursor.
>
>All suggestions welcome, including alternate approaches.
>
>TIA.............Rich
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/Never explain, never complain (Queen Elizabeth II)