Mapp view Button text color

Hello, is there a way to set the textcolor of a mapp-view button, i want to change the color of the text depending a certain value
fe if a value is 0 the color must be white , if the value is 1 the textcolor must be red if the value is 3 the color must be green.

with regards
Sven

Hello,

You can implement this using style and event.

Please check the attached sample project file. (AS4.12.7 & mappView5.24.4)
ButtonColor.zip (118.1 KB)

Recording2025-05-03204949


  1. Create a styles file for custom button style.

  1. Register the id of the style you added to the .styleset file.(1)
  2. Copy the default style of the button. And paste it into the style file you added. As an example, I changed the names to ButtonTextRed and ButtonTextGreen. (2)
  3. Change the textColor to the color (rgb) you want. (3)

  1. Connect the variable to opcUa.Event that you want to change the color of the text to. (1)
  2. Enter the conditions under which you want to change the text color. (2)
    • newValue means the value that is updated every time.
  3. Complete the Widgets.Action to change the style of the button. (3)

Best Regards,