PUBLIC oform1 oform1=NEWOBJECT("form1") oform1.Show RETURN ************************************************** *-- Form: form1 (x:\foxv\hugo\prog\imagetest.scx) *-- ParentClass: form *-- BaseClass: form *-- Time Stamp: 07/14/06 11:00:07 AM * DEFINE CLASS form1 AS form Top = 0 Left = 0 Height = 170 Width = 131 DoCreate = .T. Caption = "Form1" *-- XML Metadata for customizable properties _memberdata = "" Name = "Form1" DIMENSION cards[4] ADD OBJECT cmdexit AS commandbutton WITH ; Top = 138, ; Left = 23, ; Height = 27, ; Width = 84, ; Cancel = .T., ; Caption = "Exit", ; Name = "cmdExit" ADD OBJECT imgtest AS image WITH ; Picture = "c:\program files\microsoft visual foxpro 9\graphics\bitmaps\assorted\card.bmp", ; Stretch = 1, ; Height = 84, ; Left = 15, ; Top = 27, ; Width = 100, ; Name = "imgTest" PROCEDURE randomcard local lnCard lnCard = Int(Rand() * 4) + 1 return 'c:\program files\microsoft visual foxpro 9\graphics\bitmaps\assorted\' + thisform.Cards[lnCard] ENDPROC PROCEDURE Init thisform.Cards[1] = 'Diamond.bmp' thisform.Cards[2] = 'Club.bmp' thisform.Cards[3] = 'Heart.bmp' thisform.Cards[4] = 'Spade.bmp' ENDPROC PROCEDURE cmdexit.Click thisform.Release() ENDPROC PROCEDURE imgtest.MouseEnter LPARAMETERS nButton, nShift, nXCoord, nYCoord Dodefault(nButton, nShift, nXCoord, nYCoord) this.Picture = thisform.Randomcard() ENDPROC PROCEDURE imgtest.MouseLeave LPARAMETERS nButton, nShift, nXCoord, nYCoord Dodefault(nButton, nShift, nXCoord, nYCoord) this.Picture = 'c:\program files\microsoft visual foxpro 9\graphics\bitmaps\assorted\card.bmp' ENDPROC PROCEDURE imgtest.Click this.Picture = 'c:\program files\microsoft visual foxpro 9\graphics\bitmaps\assorted\happy.bmp' ENDPROC ENDDEFINE * *-- EndDefine: form1 **************************************************>Hi all, I'm doing a class that contains several image controls. The class is intented to mimic a toolbar with buttons showing special effects when the user hover the mouse over one of the buttons and another fx when it's clicked. I control the first effect on the mouse enter/mouse leave events and it works ok, now when the user click the button the intended image do not show for some reason. I put code on the mouse down/up events to hide the image displayed while the user is hovering over the control and show the on-click image (and in the click event for testing purposes) but it didn't show.