Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating method code when adding objects with NewObject method 1

Status
Not open for further replies.

StewartUK

Programmer
Feb 19, 2001
860
GB
I have a process that calls a basic form which, at run-time, adds to itself the objects that are needed, according to what parameter is received by the Init event.

Using this method, is there a way in which I can get code into a method of an object I have added? I would mostly want to put code in the Click event of the object that would disable other objects as needed.

Thanks for any tips,

Stewart
 

You can define your object in your main program and call it anytime you want.

DEFINE CLASS myButton AS COMMANDBUTTON
PROCEDURE CLICK
messagebox("Hello")
ENDPROC
VISIBLE = .t.
ENDDEFINE

And anytime you need it use someting like:
Thisform.addobject("myButton","myButton")

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top