Public Sub ToolBarCommands(ButtonsPage As Page,ButtonsTypes() As Int,ButtonsBmps() As String,ButtonsTags() As String)
Dim listToolBarButtons As List
listToolBarButtons.Initialize
For i = 0 To ButtonsTypes.Length - 1
Dim btn As BarButton
Select Case ButtonsTypes(i)
Case 0 ' flexible space
btn.InitializeSystem(btn.ITEM_FLEXIBLE_SPACE,"")
Case 1 ' image
Dim btm As Bitmap
btm.Initialize(File.DirAssets,ButtonsBmps(i))
btn.InitializeBitmap(btm,ButtonsTags(i))
Case 2 ' search
btn.InitializeSystem(btn.ITEM_SEARCH,ButtonsTags(i))
End Select
listToolBarButtons.Add(btn)
Next
ButtonsPage.ToolbarButtons = listToolBarButtons
End Sub