W
W
wolfak2015-05-27 18:49:09
WPF
wolfak, 2015-05-27 18:49:09

How to programmatically hide a Button in WPF and then show it again?

Good evening. I have a question, I hope you can help me.
How to programmatically hide a button or any other element in C# + XAML?
For example, there are two buttons Butt1 and Butt2, how can I make the Butt2 button disappear after clicking on Butt1, and the second time Butt1 is clicked, the Butt2 button appears again?
I know the event handler, but I don't know the hiding property. Thanks for the help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artyom, 2015-05-27
@wolfak

UI elements have a visibility property. Accordingly, when you click on the button, you need to change this property of the desired element. https://msdn.microsoft.com/en-us/library/system.wi... (v=vs.110).aspx

S
Sergey Mozhaykin, 2015-05-27
@smozhaykin

UIElement.Visibility Property

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question