Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("My_Layout")
UDP_Skt.Initialize("UDP",4211,255)
Sleep (0)
For Each V As View In Activity.GetAllViewsRecursive
If V Is Panel And V.Tag <> "" Then
Panels(V.Tag) = V
End If
Next
End Sub
Sub UDP_PacketArrived (Pkt As UDPPacket)
Dim pnl As Int
UDPRcvMsg = BytesToString(Pkt.Data, Pkt.Offset, Pkt.Length,"UTF8")
If UDPRcvMsg.Length>=13 And UDPRcvMsg.SubString2(0,10)="SetControl" Then
pnl=UDPRcvMsg.SubString2(10,13) 'Here I get panel number to make visible
If UDPRcvMsg.SubString(13)="1" Then 'if last char of received string is 1 then panel should be visible.
Panels(pnl).Visible=True
Else
Panels(pnl).Visible=False
End If
End If
End Sub