Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Background colors don't change with record change?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Background colors don't change with record change?
Miscellaneous
Thread ID:
00294375
Message ID:
00294375
Views:
58
I have a form with textboxes on it. In the form init I set all Empty textboxes to pale yellow background with a method that I added to the form as in THISFORM.setbackcolor(). That works. Textboxes containing values have a white background. That works. When I enter a value in a textbox I have code in the textbox Interactive Change event to change the background color from yellow to white or white to yellow depending upon if a value was added or removed from the textbox. That works.

But...
when I press the Next button on my form to call in the next record, the background colors stay the same as the prior record had set them. I have not been able to figure out where to put my method that I added called THIS.Setbackcolor which sets the background color to white or yellow for every textbox on the form based upon EMPTY(object.Value). Setbackcolor looks at the object.Value for EMPTY and sets the background color accordingly.

I tried THISFORM.setbackcolor in Refresh, I tried THISFORM.setbackcolor in Init, in Next and Prior command buttons, etc. Numerous places, but don't get the behavior I want on any record but the first record that is displayed. Every textbox on the form has the same working code in Interactive Change. Otherwise I only have the THISFORM.setbackcolor in my form Init right now.

I thought that adding the same code to Programmatic Change that I have in Interactive Change would set the background colors for each textbox when I pressed the Next command button and Refreshed the form, but it doesn't seem to.

I was wondering about using NODEFAULT to see if that might help.

Thanks for the help ahead of time. This seems pretty easy, but I don't know where to put the THISFORM.setbackcolor() command that runs the setbackcolor method that I added to the form. DO YOU?

Steve Kramer
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