Author Topic: BasicIndicator Text based on current state  (Read 1711 times)

madmaxed

  • Newbie
  • *
  • Posts: 8
    • View Profile
BasicIndicator Text based on current state
« on: March 25, 2015, 10:58:26 AM »
I'd like to change the text of the basic indicator depending on the which of the three color states is active.  I tried the following code, but it isn't working quite right.  Hoping to use some event from the indicator to set the text.

Private Sub BasicIndicator2_ValueSelectColor1Changed(sender As Object, e As EventArgs) Handles BasicIndicator2.ValueSelectColor1Changed
        If BasicIndicator2.SelectColor2 Then
            BasicIndicator2.Text = "Stopped"
        ElseIf BasicIndicator2.SelectColor3 Then
            BasicIndicator2.Text = "Running"
        Else : BasicIndicator2.Text = "Complete"
        End If
    End Sub


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: BasicIndicator Text based on current state
« Reply #1 on: March 25, 2015, 11:29:50 AM »
There also needs to be an event to indicate when the SelectColor3 changes. I'll add this in for the next release.

madmaxed

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: BasicIndicator Text based on current state
« Reply #2 on: March 25, 2015, 11:33:28 AM »
Again thank you.  Would there be an event for all three states?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: BasicIndicator Text based on current state
« Reply #3 on: March 25, 2015, 12:47:06 PM »
It will have 2 events, one for SelectColor2ValueChanged and SelectColor3ValueChanged, so yes based on those 2 events you will be able to determine whenever any color change occurs.