Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
NrItem=2
CreateAddView
End sub
Sub CreateAddView
Dim i As Int
For i=0 To NrItem-1
panel1.Initialize("")
panel1.SetLayout(0%x,0%x,100%x,100%x)
BtItem1.Initialize("")
BtItem1.Text="Item"&i
BtItem1.Tag=i
panel1.AddView(BtItem1,1%x,1%x,27%x,HorizontalScrollViewItem.Height-2%x)
HorizontalScrollViewItem.Panel1.AddView(panel,0%x,0%x,320%x,HorizontalScrollViewItem.Height)
Next
HorizontalScrollViewItem.Panel.Width=(NrItem)*(40%x)
End Sub