Sub CreateListItemEvents(Text As String, Width As Int, Height As Int,index As Int) As Panel
Dim p As Panel
p.Initialize("")
'we need to add the panel to a parent to set its dimensions. It will be removed after the layout is loaded.
Activity.AddView(p, 0, 0, Width, Height)
p.LoadLayout("CellItemEvents")
'label1 and button1 will point to the last added views.
lblEvents.Text = Text
'txtEvent.Tag=index
p.Tag=index
p.RemoveView
Return p
End Sub