Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fellow CLASSmates. I need help with classes.
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Fellow CLASSmates. I need help with classes.
Miscellaneous
Thread ID:
00287405
Message ID:
00287405
Views:
57
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.com
Would you believe Far Side Lite?
More than 270 original cartoons.
Next
Reply
Map
View

Click here to load this message in the networking platform