No announcement yet.

Dynamically change widgets properties

  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamically change widgets properties

    Hi there,

    i'd like to change the percent-properties of the 3-colored gauge widget during runtime according to user input.
    It seems I can only change those in the Object Inspector before compiling, but not via code.

    A possible workaround seems to be to recreate the gauge widget with graphic primitives (individual lines in a for-loop) as demonstrated in the analogue input demo.
    But before I try that I just wanted to be confirmed that there is in deed no "easier" way around this.

    Thanks a lot for your help!

  • #2

    Welcome to the forum.

    The percent properties can only be changed during design time in the object inspector. However, if the range of change is known then it is possible to create multiples of the gauge widget with different percent ranges and then select the required widget based on the percent range that you need to display.

    I hope this helps

    Best regards



    • #3
      Hi Paul,

      this would mean creating a buckload of widgets to give all possible ranges.
      Drawing this gauge manually now really seems like the lesser evil.

      Thanks for the quick answer and keep up the good work!