Issue
I would like to hide a button after it was clicked but I don't know how.
C#
private async void btn1Clicked(object sender, EventArgs e)
{
if (condition)
{
// hide button
}
}
XAML
<Button Clicked="btn1Clicked"/>
Solution
You can do the following
private async void btn1Clicked(object sender, EventArgs e)
{
Button btn = (Button)sender;
if(condition)
{
// hide the button
btn.IsVisible = false;
// or disable the button.
// As Caius Jard said, disappearing buttons sometimes cause confusion.
btn.IsEnabled = false;
}
}
Answered By - Dorin Baba
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.