×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Photos in a grid: Strange behavior

Photos in a grid: Strange behavior

Photos in a grid: Strange behavior

(OP)
Hi,
I'm learning to configure a grid with photos (in Visual FoxPro 6) when creating a grid either with a cursor or with a database, the column that displays the photos presents a strange behavior: when clicking on a photo, one or two photos of the other cells in that column are changed (the change affects only the display, not the original file) I have reviewed the properties and I cannot find a single clue as to what could be causing this strange behavior. I have based it on an example that I found on the web, here I attach the example that I found in the hope that someone can detect the error. The idea is that when you click on a photo, this photo and the others stay in place.
Thank you for your help.

RE: Photos in a grid: Strange behavior

Hi,

You may want to have a look at the code snippet below. It's a contribution from Olaf Doschke in thread184-1738143: Image in grid. I fine tuned it only a little bit.

CODE -->

Public oForm

oForm = Createobject('myForm')
oForm.Show()

READ EVENTS

CLOSE ALL
CLEAR ALL 

**********

DEFINE Class myForm As Form
  Height = 360
  Width = 840
  Add Object myGrid As Grid With Height = 360, Width = 840, RecordSource = 'tblImageList'

  Procedure Load
    Local Array laImageList[1]
    Local lcPath
    
    lcPath = Home()+'Graphics\Bitmaps\Offctlbr\Large\Color'
    
    Create Cursor tblImageList (FileName M)
    
    For lix = 1 To Adir(laImageList, Addbs(m.lcPath) + '*.*')
      Insert Into tblImageList Values (Addbs(m.lcPath) ++ laImageList[lix,1])
    Endfor
 
*!*	    For lix = 1 To Adir(laImageList, "*.jpg")
*!*	      Insert Into tblImageList Values (laImageList[lix,1])
*!*	    Endfor
     
    Go Top
  Endproc

  Procedure Init
    With This.myGrid
      .ColumnCount = 2
      .RowHeight = 24
      .Anchor = 15

      With .Columns(1)
        .AddObject('edtBox','EditBox')
        .CurrentControl = 'edtBox'
        .Width = 720
        .Sparse = .F.
        .edtBox.Visible = .T.
      Endwith

      With .Columns(2)
      	.Header1.Caption = ""
        .AddObject('imgImage','myImage')
        .CurrentControl = 'imgImage'
        .Width = 24
        .Sparse = .F.
        .imgImage.ImageFilename = "tblImageList.FileName"
        .imgImage.Visible = .T.
      Endwith
    Endwith
  ENDPROC
  
  PROCEDURE Destroy()
  	ThisForm.Release()
  	CLEAR EVENTS()
  ENDPROC 
  
ENDDEFINE 

**********

DEFINE Class myImage as Image
   ImageFileName = ""
   
   PROCEDURE Backstyle_Access()
      This.Picture = Evaluate(this.ImageFileName)
      Return This.BackStyle
   ENDPROC
   
ENDDEFINE 

It also works with your pictures - but please don't use this kind of offensive pictures in a demo.

hth

MarK

RE: Photos in a grid: Strange behavior

(OP)
Thank you very much for the source code, I will try to implement it.

Quote (Mark)

but please don't use this kind of offensive pictures in a demo
About the images, the demo originally includes those adult women in lingerie, I just limited to forwarding it without modifying anything to avoid altering the demo in any way. I'm sorry if you were offended, that was not my intention.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close