Sub loadlvemailaddy
' This part populates the ListView
lvEmailAddy.Clear
Main.dbCursor = Main.SQL1.ExecQuery("SELECT name, email FROM emailaddresses ORDER by name")
For i = 0 To Main.dbCursor.RowCount - 1
Main.dbCursor.Position = i
' Set up the ListView
lvEmailAddy.AddSingleLine(Main.dbCursor.GetString("name") & " :" & Main.dbCursor.GetString("email"))
lvEmailAddy.SingleLineLayout.ItemHeight = 60dip
lvEmailAddy.SingleLineLayout.Label.TextSize = 16
lvEmailAddy.SingleLineLayout.Label.TextColor = Colors.White
lvEmailAddy.SingleLineLayout.Label.Gravity = Gravity.LEFT
lvEmailAddy.ScrollingBackgroundColor = Colors.Transparent
Next
End Sub
Sub lvEmailAddy_ItemClick (Position As Int, Value As Object)
Dim emailaddy As String
Dim selectedrecord As String
selectedrecord = Value
countit = selectedrecord.IndexOf(":")
selectedrecord = selectedrecord.SubString2(0,countit)
Msgbox(selectedrecord,"")
emailaddy = Main.SQL1.ExecQuerySingleResult("SELECT email FROM emailaddresses WHERE name = '" & selectedrecord & "'"))
Msgbox(emailaddy,"")
'sendinvoice
'Msgbox("Invoice sent","")
Panel1.Visible = False
End Sub