M MDEnt Member Licensed User Longtime User Mar 15, 2011 #1 Is it possible to add three buttons on the back Keycode such as: Quit, Cancel, Restart in a MsgBox(2)? Quit - would quit the application Cancel - would return the user to the previous screen Restart - would return the user to a specific view I'm using the below as a starting point: All is working well as is - but cancel/no are almost the same thing and would like to replace one with a restart instead. I've tried modifying a few ways with no luck. Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event If KeyCode = KeyCodes.KEYCODE_BACK Then If Msgbox2("Do you want to close?", "", "Yes", "Cancel", "No", Null) = DialogResponse.POSITIVE Then Return False Else Return True End If End If End Sub Thanks!
Is it possible to add three buttons on the back Keycode such as: Quit, Cancel, Restart in a MsgBox(2)? Quit - would quit the application Cancel - would return the user to the previous screen Restart - would return the user to a specific view I'm using the below as a starting point: All is working well as is - but cancel/no are almost the same thing and would like to replace one with a restart instead. I've tried modifying a few ways with no luck. Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event If KeyCode = KeyCodes.KEYCODE_BACK Then If Msgbox2("Do you want to close?", "", "Yes", "Cancel", "No", Null) = DialogResponse.POSITIVE Then Return False Else Return True End If End If End Sub Thanks!
agraham Expert Licensed User Longtime User Mar 15, 2011 #2 What's wrong with Code: Select Msgbox2("Do you want to close?", "", "Yes", "Restart", "No", Null) Case DialogResponse.NEGATIVE ' whatever Case DialogResponse.CANCEL ' whatever Case DialogResponse.POSITIVE ' whatever End Select Upvote 0
What's wrong with Code: Select Msgbox2("Do you want to close?", "", "Yes", "Restart", "No", Null) Case DialogResponse.NEGATIVE ' whatever Case DialogResponse.CANCEL ' whatever Case DialogResponse.POSITIVE ' whatever End Select
M MDEnt Member Licensed User Longtime User Mar 15, 2011 #3 Didn't consider using Case - Thanks. Upvote 0