Sub Switch_In_ScrollView(Anzahl As Int) 'ScrollView wird platziert und gefüllt
Dim counter As Int = 1
Dim Chanel As Int = 1
Dim SVhohe As Int
Select Anzahl
Case 8: SVhohe = 48dip
Case 16: SVhohe = 96dip
Case 32: SVhohe = 192dip
Case 64:SVhohe = 385dip
End Select
Anzahl = Anzahl -1
ScrollView1.Initialize(SVhohe * 10) 'Innere Höhe definieren (nicht sichtbar) 32=193dip, 64=385dip
ScrollView1.Color=Colors.White
ScrollView1.RemoveView
Activity.AddView(ScrollView1, 10dip, 160dip, 100%x - 20dip, 100%y - 165dip) 'Sichtbare: Linksabstand, Obenabstand, Breite, Höhe definieren
For i = 0 To Anzahl
Dim p As Panel
p.Initialize("")
If counter > 128 Then
counter = 1
Chanel = Chanel + 1
End If
p.Tag = Chanel & "|" & counter
counter = counter * 2
p.LoadLayout("SwitchButton")
ToggleButton1.Tag = Chanel
Label1.Text="Relais " & (i+1)
For v = 0 To p.NumberOfViews - 1
p.GetView(v).Tag = p 'set the panel as the Tag value
Next
ScrollView1.Panel.AddView(p, 0, i * 60dip, ScrollView1.Panel.Width, 58dip)
Next
ToastMessageShow(p.Height,True)
End Sub