I defined a class as follows:
DEFINE CLASS txtcolorempty AS textbox
PROCEDURE Refresh
this.backcolor = iif(empty(this.value), rgb(255,255,128), rgb(255,255,255))
ENDPROC
PROCEDURE InteractiveChange
this.refresh()
ENDPROC
ENDDEFINE
I saved this code inside a .PRG file called CLASCODE.PRG
This class will make a textbox background pale yellow if the textbox is left blank. Otherwise the background will be white if there is a value in the testbox.
I already have all of my textboxes on my forms and they are all based upon the default textbox class. I can't understand how to take this class definition and incorporate it into my existing textboxes.
According to what I read, I am doing the following:
In the Init event of each textbox object on my form I have:
SET PROCEDURE TO CLASCODE ADDITIVE
But then, I get lost. Why would I need to do a CREATEOBJECT based upon the new CLASS definition when I already have my object based upon the old default textbox class. Isn't there an easy way to have the old textbox pick up the new CLASCODE definition without recreating all of my textboxes based upon my new class definition?
I don't understand why I need CREATEOBJECT("txtcolorempty") to create a new object. Can someone explain how I can incoporate the new class definition into the old textbox objects on the form. Thanks very much.
Sincerely,
Steve Kramer
Kramer & Kramer Design
Steve Kramer
Kramer & Kramer Design
"Home of Go Cartoons"
Web Site:
www.stephenkramer.comWould you believe Far Side Lite?
More than 270 original cartoons.