Sub Button1_Click
Dim list1 As List
list1 = Contacts2.GetAll(True, False)
Dim listOfContacts As List
listOfContacts.Initialize
For i = 0 To list1.Size - 1
Dim c As Contact
c = list1.Get(i)
If c.DisplayName.IndexOf("@") = -1 Then
listOfContacts.Add(c.DisplayName)
listOfContacts.Sort(True)
End If
Next
Dim res As Int
res = InputList(listOfContacts, "Choose contact", -1)
If res <> DialogResponse.CANCEL Then
Dim name As String
name = listOfContacts.Get(res)
Dim c As Contact
For i = 0 To list1.Size
c = list1.Get(i)
If c.DisplayName = name Then Exit
Next
If c.Name.Length > 0 Then
Label1.Text = name
Dim m As Map
m = c.GetPhones
If m.Size > 0 Then
Label2.Text = m.GetKeyAt(0)
Dim photo As Bitmap
photo = c.GetPhoto
If Photo <> Null Then
Button1.SetBackgroundImage(photo)
Else
Button1.SetBackgroundImage(LoadBitmap(File.DirAssets,"NoPhoto.png"))
End If
End If
End If
End If
End Sub