Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Creating a button to change background color


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

Recommended Posts

  • Newbies
Posted

Hello all

I have created radio buttons to toggle between "active" and "inactive" clients. I am trying to find a way to change the background color of the entry depending on which is selected.

So "active" clients will have a white background and "inactive" clients will have a gray background.

I have no experience with scripting or any advanced FM techniques, so I am at a complete loss in trying to figure out how to achieve this.

Any help would be greatly appreciated.

Thanks.

Posted

To achive this, use two container fields (globally stored) to hold the source graphics, and a calculation with container result to show the correct graphic based on whatever criteria:

result_graphic (calculation, container result) = case(status = "Active"; gWhite_graphic; gGrey_graphic)

Then in Browse Mode, insert the desired graphic into each source container field. Finally in your layout put the result_graphic field in the background, set its option to expand or contract to fit, and change the field's behavior to not allow entry.

Note: In FM7, there may be an undesireable flash effect when changing records with this container graphic. I think this is fixed in FM8 though.

  • Newbies
Posted

Thanks for your reply, Ender. I'm such a newbie with FM that your explanation is confusing to me.

What is a source graphic? An actual image?

How do I create a calcualtion with a container result?

And I don't quite get how to read the formula you posted.

Sorry to be such a dunce, I'm still working on that learning curve.

Posted (edited)

Ender has provided you with what you need, but I will try to expand on his post a little to see if it will help.

You need the following fields plus your [color:blue]Status Field,

[color:blue]gWhite_graphic [color:green](Container, Global)

[color:blue]gGrey_graphic [color:green](Container, Global)

[color:blue]result_graphic [color:green](Calculation, Result Container) [color:blue]=

[color:red]case(status = "Active"; gWhite_graphic; gGrey_graphic)

Now with that said, take a look at this simple file and see if it makes sense to you.

Lee

RadioButtonContainer.fp7.zip

Edited by Guest
Posted

I've been on FMForums for about a month now -- and I've seen this topic probably a half dozen times, all expressed with a varying degree of clarity.

This clear and complete explanation is an excellent example of why FMForums is such a great resource.

For those of us just starting out with FMP it would be extremely valuable to have a catalog of a couple of dozen samples (maybe 50?) that are this clear and to the point. There are, of course, many contributed "application examples" that are valuable as models to examine. But this type of "special feature" is often hard to isolate in them in order to really understand only "it".

Having a "Simple Feature Examples" section, separate from the existing "Tips and Tricks", could probably answer a lot of newbie questions and help us grasp the more advanced examples a lot quicker.

Anyone agree?

Posted

There are several sites that have tip and trick files available. Check the Resource Topic Area for a few sites, books, and training videos.

When I first started getting serious about learning all of the functions, and script steps, etc., I started with the old Everything CD, and Scriptology: Filemaker Pro Demystified, both written in version 3/4 days.

Two excellent resource sites are:

Database Pros

There is a File there that I would Recommend any Newbee to v7/8 purchase called: FileMaker 7 Reference

It has a lot of examples of the Functions, and you can, once you get the hang of it, make your own examples.

The other site is: ISO Productions

Also,

Foundation Database Systems aka CodeMaster

They have a free file called Developer Storage that is handy to keep good calculations, scripts, Custom Functions, etc.

HTH

Lee

Posted

Thanks, Lee. Database Pros looks like an excellent resource. Somehow I missed finding it. ISO Productions and Codemasters are sites that I have spent time with. I certainly agree that every person new to FMP should start with them.

Yet I can't help but feel that the "nuggets" (like yours above) that are buried in this forum could be equally valuable. Maybe someone could set up links to the "Top 40" sometime (in their spare time?).

Anyway, thanks for the recommendations.

This topic is 6857 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.