Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
If panelSearch.Visible=True Then
panelSearch.Visible=False
Return True
End If
res = Msgbox2("Do you want to exit?", "", "Yes", "", "No", Null)
If res = DialogResponse.NEGATIVE Then Return True
End If
Return False
End Sub