btn1 is a local variable declared in the routine Activity_Create.
Could be more explicit,by modifying the code below?
[ Code]
Sub Activity_Create(FirstTime As Boolean)
Dim panels(6) As Panel
For i = 0 To panels.Length - 1
panels(i).Initialize("panels")
panels(i).Color = Colors.RGB(Rnd(0, 255), Rnd(0, 255), Rnd(0, 255))
Dim btn1 As Button
Dim lbl As Label
lbl.Initialize("")
btn1.Initialize("")
lbl.Text = "Page:" & i
lbl.TextSize = 20
lbl.TextColor = Colors.White
panels(i).AddView(lbl, 75%x, 2%y, 60%x, 30dip)
panels(i).AddView(btn1, 25%x, 10%y, 20%x, 70dip)
Activity.AddView(panels(i), 100%x, 0, 100%x, 100%y - 80dip) 'add the panel to the layout
Activity.AddMenuItem("Panel #" & i, "Menu")
Next
'add the Left and Right button
btnLeft.Initialize("Left")
btnLeft.Text = ">"
Activity.AddView(btnLeft, 60%x, 100%y - 75dip, 100dip, 50dip)
btnRight.Initialize("Right")
btnRight.Text = "<"
Activity.AddView(btnRight, 10%x, 100%y - 75dip, 100dip, 50dip)
'Load Bitmaps for indicator
ActiveBitmap.Initialize(File.DirAssets, "indicator_active.png")
InactiveBitmap.Initialize(File.DirAssets, "indicator_inactive.png")
'*****************************
'Initialize the SlidingData object and set the array of panels.
'Then we call SlidingPanels.Initialize to prepare the animation objects.
'The last call to ChangePanel brings the first panel.
sd.Initialize
SlidingPanels.Initialize(sd, panels, True, 150)
sd.currentPanel = currentPanelBeforePaused - 1
Indicator = SlidingPanels.CreatePageIndicator(panels.Length, InactiveBitmap, 120dip, 16dip)
Activity.AddView(Indicator, (100%x - 120dip) / 2, 0, 120dip, 16dip)
Indicator.BringToFront
ChangePanel(0)
End Sub
[ /Code]