Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
NavControl.ShowPage(Page1)
Page1.RootPanel.LoadLayout("1")
SetImageSegments(SegmentedControl1, Array(LoadBitmap(File.DirAssets, "smiley.png"), _
LoadBitmap(File.DirAssets, "icon-40.png")))
End Sub
Sub SetImageSegments(sc As SegmentedControl, Images As List)
Dim no As NativeObject = sc
no.RunMethod("removeAllSegments", Null)
For i = 0 To Images.Size - 1
no.RunMethod("insertSegmentWithImage:atIndex:animated:", Array(Images.Get(i), i, True))
Next
End Sub