3 Replies Latest reply on Dec 8, 2017 6:43 AM by John Messinger

    Change button background color in Processbook

    alanR

      Hi ,

       

       

      Im trying to change the backgroundColor of a button in Processbook on click but it does not seem to be working?

       

       

      My Code;

       

       

      `background = ThisDisplay.SelectedSymbols(1).BackgroundColor = pbBlack`

       

       

      What could i be doing wrong here?

        • Re: Change button background color in Processbook
          John Messinger

          Hi Alan,

           

          Try the following:

           

          CommandButton1.BackColor = pbBlack
          

           

          The problem with your current code is that the button is not actually selected when you click on it.

           

          John

            • Re: Change button background color in Processbook
              alanR

              Thanks John , for the reply. . Im trying to change the backgroundColour of a selected symbol how do i do that?

                • Re: Change button background color in Processbook
                  John Messinger

                  Ah, sorry, I interpreted your original post as wanting to change the background colour of the button you were clicking.

                   

                  Out of curiosity, what is the symbol type that you are trying to modify? Not all symbols on a display are necessarily scriptable by default (especially those 'static' symbols that can be added to the display). If it is one of these symbols, you will need to explicitly enable scripting on it. To do so, switch to Build mode, and right mouse click the target symbol to bring up the following context menu:

                   

                   

                  Click the 'Enable Scripting' item and then you should be good to go.

                   

                  Now, depending on the symbol type, what you want to change may possibly be the FillColor property, not necessarily the BackgroundColor. This is especially true for static symbols such as Rectangles, Ellipses, and other filled polygons.

                  2 of 2 people found this helpful