For i = 0 To Cursor1.RowCount -1
Cursor1.Position = i
lblMenuItem(i).Initialize("lblMenuItem")
lblMenuItem(i).TextColor = Colors.Gray
lblMenuItem(i).Text = Cursor1.GetString("name").Trim
If I = 0 Then
lblMenuItem(i).TextColor = Colors.Red
Else
lblMenuItem(i).TextColor = Colors.Black
End If
lblMenuItem(i).Tag = i
'lblMenuItem(i).Typeface = Typeface.STYLE_BOLD
'itemMenuWidth = lblMenuItem(i).Text.Length * 12
lblMenuItem(i).TextSize = 18
lblMenuItem(i).SingleLine = True
menusPosH(i) = hPos
scrlMenus.Panel.AddView(lblMenuItem(i),hPos,scrlMenus.Height * 0.1,itemMenuWidth,scrlMenus.Height)
'SetAutoSizeBasedOnText(lblMenuItem(i))
hPos = hPos + itemMenuWidth + 10
Next