Yes No button on Panel via StackOverflow

MDEnt

Member
Licensed User
Longtime User
Hi Erel - Without repeating our entire thread at StackOverflow... here is the yes no button on a panel.

I hit the back key to get the panel visible. The yes and no on the panel work fine.

If I hit the back key to get the panel visible - and then hit the back key again ( a second or multiple times) - which a user may do on purpose or by accident - it seems to kill the no button - and the yes button still works.
 

Attachments

  • yesnolabelbutton.zip
    6.7 KB · Views: 212

klaus

Expert
Licensed User
Longtime User
The problem in your code is that at each back button click you add a new Panel. So if the user clicks 3 times the button you will have three panesl.
The Yes button works always because you close the app. But the No button only hides the last panel added, leaving the others on the screen making you feel that it has no effect.

Attached you find a modofied version, where the panel is initialized only once in Activity_Create, and when the back button is clicked the program checks if the panel already visible and has no effect in this case and otherwise set the panel to visible.

Best regards.
 

Attachments

  • yesnolabelbutton1.zip
    6.8 KB · Views: 234
Upvote 0

MDEnt

Member
Licensed User
Longtime User
Thanks so much. I had a hunch Init was a possible cause. Still wrapping my head around things as I learn!
 
Upvote 0
Top