Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Redefine click method in code
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Redefine click method in code
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01114794
Message ID:
01114794
Views:
47
OK, here I am instantiating a visual class on a form using code - but I want to define (or perhaps redefine) the button's click event dynamically.

Can someone show me a simple example?

Here's how I'm creating it:
	* Create progress message and cancel button
	lcWaitObjectName = THIS.Name + [Progress]
	IF TYPE(lcWaitObjectName) = "O"
		&lcWaitObjectName..Visible = .T.
	ELSE
		* Create object
		=THISFORM.NewObject(lcWaitObjectName,ctnProgressWindow,"Connection_Lib.vcx")
		PROCEDURE cmdcancel.Click
			* CmdCancel Click
			DO something.prg
		ENDPROC
		THISFORM.&lcWaitObjectName..Left  = 10
		THISFORM.&lcWaitObjectName..Top   = 10
		THISFORM.&lcWaitObjectName..WIDTH = THISFORM.Width - 20
		THISFORM.&lcWaitObjectName..HEIGHT = THISFORM.Height - 20
	ENDIF
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Next
Reply
Map
View

Click here to load this message in the networking platform