3 Replies Latest reply on Apr 17, 2012 9:17 AM by philmodjunk

    Hide image(button) if Field value = 0

    ShaikhAtta1238

      Title

      Hide image(button) if Field value = 0

      Post

      Hello everybody, 

                                I want an image (also functioning as a button) to be displayed if a field value = 0 and once the field value = 1 then the image should disappear automatically. 

       

      Regards,

        • 1. Re: Hide image(button) if Field value = 0
          philmodjunk

          Put the image in a global container field.

          Define a calculation with "container" specified as its return type.

          Define the calculation as:

          If ( FieldValue = 0 ; GlobalContainerField )

          Put this calculation field on your layout and either set it up as your button.

          • 2. Re: Hide image(button) if Field value = 0
            Dillik

            Phil's response is workable and sensible.  As another approach that would avoid the two extra fields described above, you could put the image-based button on your layout, then overlap that with a text object containing only a space; normally the text object should be transparent, but give it a conditional-formatting fill color to match your layout background for the condition(s) in which it should blank out the button (FieldValue = 1 ).

            The weakness here is that it'd be nigh-impossible to mask the button if the layout background were a gradient, image, or anything else other than a solid color.  Also, any tooltip text you have on the image-button would be suppressed by the overlapping text object; if you needed a tooltip using this approach, you'd need to put it on the text object.

            • 3. Re: Hide image(button) if Field value = 0
              philmodjunk

              There are a number of options for controlling layout object visibility. See this demo file: http://www.4shared.com/file/XGrhkmVV/LayoutObjectVisibilityControlD.html

              In addition, I've read that Filemaker 12 users can use conditional formatting to make tab panels appear and disappear--though I haven't tried it...