Showing posts with label field labels. Show all posts
Showing posts with label field labels. Show all posts

8/01/2012

Changing Label Colors (ZP SQL & ZP 32)

I have written before about how to use a script to change the text assigned to a field label. Today I had a customer ask if you could also change the color of the label to make it stand out. In this example I'm selecting "Base" as the Module, "Property" as the Screen, and "Screen" as the Action and my script is:


propscreen.zp_pageframe1.page1.lblExist_use.Caption = "Warning"
propscreen.zp_pageframe1.page1.lblExist_use.Forecolor = RGB(255,0,0)

The first line changes the label for the Existing Use field on the Property Screen to "Warning." The second line makes that label red. To change the color of a field you enter in three Red/Green/Blue values from 0 to 255. Different values produce the rainbow of colors. You can use a number of web sites to learn the RGB values for any color you desire.

3/03/2010

Changing Field Labels

One of the most popular uses for User Defined Scripts in ZonePro is for changing the screen labels in front of fields. In this example I'm selecting "Base" as the Module, "Property" as the Screen, and "Screen" as the Action and my script is:

propscreen.zp_pageframe1.page2.lblFlood.Caption = "School"

This will change the "Flood" label on the Extra tab of the Property screen to now read "School." To create a script like this you need to know several things that typically require our involvement. You need to know that the internal name for the Property screen is "propscreen" and that the Extra tab is referenced as "zp_pageframe1.page2". Once you know that you can theoretically change the label for any field on that tab. The trickier bit is knowing that the Flood label is called "lblFlood".  Usually the label for a field is the same as the internal field name prefixed by "lbl", but unfortunately we were not always consistent in our naming habits. A quick e-mail to us though will get you the answers to the screen and label names you want to change.