Jump to content
Server Maintenance This Week. ×

Changing the Colour of a text area or other object


This topic is 7114 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I know in FM 7 you can manipulate text colour, font, etc. based on the value of the text (such as if status is Open, the text is green, if it is closed, the text is red).

BUT, is there a way to manipulate the background colour of a text area the same way?

Reason for my asking is that I have a button to submit a record. Over that button I have a text area with a transparent background showing the status (unsubmitted). I want to change the background colour of the text area to match the background of the record/layout when the record is submitted, so the button "disappears".

Link to comment
Share on other sites

A couple of members on here helped me with the same thing, here is what helped me. If you need a copy of the database I worked on let me know.

Generally you need a new calculation field and some global fields. The calculation would look something like:

Case(

fieldname = "Bronze"; g_bronze;

fieldname = "Silver"; g_silver;

fieldname = "Gold"; g_gold;

g_white)

Into the g_fields you insert a rectangle with the respective colour, which is displayed by the calc field depending on the content ot the original field. You only have to make the calc field an exact copy of the original, place it behind and make the original transparent.

Dave

Link to comment
Share on other sites

If your global fieldnames contain the desired color, as in Dave's example, you can use GetField instead of Case.

GetField("g_" & fieldname)

If the field background is white, then you shouldn't need a g_white either, as it would be blank if there were no result.

Link to comment
Share on other sites

This topic is 7114 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.