Sub partlist_Click
Dim selsom As ListView
selsom.Initialize("selsom_click")
Activity.AddView(selsom,5,5,100%x -5dip,100%y -5dip)
Dim Cursor1 As Cursor
Cursor1 = db.ExecQuery("SELECT nev, ROWID from partner")
If Cursor1.RowCount > 0 Then
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
selsom.AddSingleLine(Cursor1.GetInt("ROWID") & "-" & Cursor1.GetString("nev"))
Next
selsom.AddSingleLine("Add new...")
Else
ToastMessageShow("Empty database, use add new",True)
selsom.AddSingleLine("Add new...")
End If
Cursor1.Close
selsom.BringToFront
selsom.Color = Colors.Black
selsom.SingleLineLayout.Label.TextColor = Colors.White
End Sub