Sub Activity_KeyPress(KeyCode As Int) As Boolean
Dim Selection As Short
If KeyCode = KeyCodes.KEYCODE_BACK Then
Selection = Msgbox2("Did you remember to save record. Exit application?".ToUpperCase, "C o n f i r m a t i o n", "Yes", "", "No", Null)
Select Selection
Case DialogResponse.POSITIVE
Activity.Finish
Case DialogResponse.CANCEL, DialogResponse.NEGATIVE
Return True
End Select
End If
End Sub