Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mousedown event not firing???
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01136011
Message ID:
01136505
Views:
10
Hi Enmanuel,

If I understood your code correctly, I can not reproduce the problem, below is my try (I use bmps, let me find what happens with pngs, just read that part):

[Update] I change all bmps to pngs and it also works) [/Update]
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.
>
>What can be wrong with this approach? The click event is firing properly but the image still didn't show. I'm using image controls as buttons instead of regular buttons because I'm using png images with transparency and they do not show well on buttons without loading'em on a image control anyway.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Reply
Map
View

Click here to load this message in the networking platform