So having seen the example program I can point out a few things. First you are using the Window class name to access properties of the window, this is causing “Implicit Instance” problems. Click on each window in your project and click on the Cog in the inspector. Disable “Implicit Instance” checkbox. It will only cause you problems. Do not use the Class name of the Window to reference the Window. For example:
Select Case SKift
Case 0
Window1.BackGroundColor=Color.RGB(0,0,0) //this line seems to be necessarry!
Window1.BackGroundColor=Color.RGB(255,0,0) //red color
Case 1
Window1.BackGroundColor=Color.RGB(0,0,0) //this line seems to be necessarry!
Window1.BackGroundColor=Color.RGB(0,255,0) //green color
Case Else
Window1.BackGroundColor=Color.RGB(0,0,0) //this line seems to be necessarry!
Window1.BackGroundColor=Color.RGB(0,0,255) //blue color
End Select
if skift<2 then
Skift=Skift+1
else
Skift=0
End if
Instead of Window1 you should use Self as the window you are accessing is the current one that this timer is on. The code becomes:
Select Case SKift
Case 0
Self.BackGroundColor=Color.RGB(0,0,0) //this line seems to be necessarry!
Self.BackGroundColor=Color.RGB(255,0,0) //red color
Case 1
Self.BackGroundColor=Color.RGB(0,0,0) //this line seems to be necessarry!
Self.BackGroundColor=Color.RGB(0,255,0) //green color
Case Else
Self.BackGroundColor=Color.RGB(0,0,0) //this line seems to be necessarry!
Self.BackGroundColor=Color.RGB(0,0,255) //blue color
End Select
if skift<2 then
Skift=Skift+1
else
Skift=0
End if
In terms of this line:
Self.BackGroundColor=Color.RGB(0,0,0) //this line seems to be necessary!
It isn’t required on the Mac, I can’t say for Windows or Linux.
Secondly the commented out item in the button Pressed event:
Label1.Text = PanelData(0).PanelSMS //I supposed it's a scope problem?
I can’t really tell from this example what the issue is because PanelData is not defined anywhere in the example. If PanelData is defined outside of the Window then it can be good practice to use the reference to that location. For example if it is in a Module and is Public then this reference could work. However you could also try:
Label1.Text = Module1.PanelData(0).PanelSMS
Especially if PanelData is defined in more than one place.
For other people trying to help this is truly a Structure. It is defined as follows:
Structure defPanelData
PanelVoltage as String * 6
PanelCurrent As String * 6
PanelSMS as String * 8
End Structure
I suspect that this is used in an API call so is best left as a Structure in this case.