4 Replies Latest reply on Jul 5, 2012 1:36 PM by JimMac

    Programatically Fill Edit Box with certain color

    BoydReilly

      Title

      Programatically Fill Edit Box with certain color

      Post

      I searched the forums and couldn't find an answer.

      I have an Edit Box that the user will fill in with some text.  I would like to give the user the option to change the background color.  Preferably, they would a choose of the color, such as yellow, light blue, etc, from a list.  I'm less worried about making a list as I am interested in how the user can change the background color.

      Any idea how to go about this?

      TIA.

      BR

        • 1. Re: Programatically Fill Edit Box with certain color
          philmodjunk

          Use a series of conditional format expressions set on the field. Each expression checks for one specific color selection so you need one expression for each color on the list.

          • 2. Re: Programatically Fill Edit Box with certain color
            BoydReilly

            I think I understand what you're saying.  However, I still don't understand how to change the background of the edit box. Let's say 'light blue is picked.  How do I go about changing the background in the edit box to light blue?

            Thanks.

            BR

            • 3. Re: Programatically Fill Edit Box with certain color
              philmodjunk

              Say your field with the value list of colors is named: YourTable::ColorList

              Add a conditional format expression such as:

              YourTable::ColorList = "Light Blue"

              Then select the fill color for a light shade of blue.

              • 4. Re: Programatically Fill Edit Box with certain color
                JimMac

                Conditional formatting is primarily used to change each individual "field" formating. You find that "Conditional Formatting" option is the Layout mode.  Select a field and Format>Conditional...  (or right click on field to get Contional Formatting...).  Select that option and you get a dialog with tests on the CONTENTS of that selected field.  This is a functional test to help give added emphasis to the user, and generally not for esthetics.

                I see no easy way to select an editbox back ground color, but Phil, being the creative guy he is, showed a way to set a field to be selected from a List of pre-determined colors.

                For example: create a new variable called BkGrndClr.  Make a list of colors, say for Mardi Gras...  Purple, Green and Gold. Now the user feels sad Frown that day and wants Purple backgrounds.  He then selects the Purple from the drop down value of BkGrndClr .

                Next in every field you want to be Purple, Green, Gold or if empty the orignial background color, you must set a "Conditional formatting" of at least 3 tests.

                Tests as follows:

                BkGrndClr = "Purple"      // the 1st test formula  then you select a light color of purple

                BkGrndClr = "Green"      // the 2nd test formula   then you select a light color of green

                BkGrndClr = "Gold"      // the 3rd test formula     then you select a light color of gold

                 

                Note if none are true the original background color is used

                Now, repeat that in each and every editbox you want to change colors in or shift click select all of them when you conditional format.

                Note: each preselected color must have a conditional test and the user doesn't get a "color wheel" to pick his shade.

                Jim...