Hi,
im trying to change colors of basic shape by value. I added basic shapes to form and datasubscriber and add some PLCAddressValueItems (D125,D126), but doesnt work.
Thats my code
Private Sub DataSubscriber21_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber21.DataChanged
If e.PlcAddress = "D125" = "0" Then
BasicShape1.BackColor = Color.LightGray
ElseIf e.PlcAddress = "D125" = "1" Then
BasicShape1.BackColor = Color.FromArgb(255, 255, 220)
ElseIf e.PlcAddress = "D125" = "2" Then
BasicShape1.BackColor = Color.FromArgb(255, 255, 170)
ElseIf e.PlcAddress = "D125" = "3" Then
BasicShape1.BackColor = Color.FromArgb(255, 255, 120)
ElseIf e.PlcAddress = "D125" = "4" Then
BasicShape1.BackColor = Color.FromArgb(255, 255, 50)
ElseIf e.PlcAddress = "D126" = "0" Then
BasicShape2.BackColor = Color.LightGray
ElseIf e.PlcAddress = "D126" = "1" Then
BasicShape2.BackColor = Color.FromArgb(255, 255, 220)
ElseIf e.PlcAddress = "D126" = "2" Then
BasicShape2.BackColor = Color.FromArgb(255, 255, 170)
ElseIf e.PlcAddress = "D126" = "3" Then
BasicShape2.BackColor = Color.FromArgb(255, 255, 120)
ElseIf e.PlcAddress = "D126" = "4" Then
BasicShape2.BackColor = Color.FromArgb(255, 255, 50)
End If
End Sub