Click here to Skip to main content
15,894,410 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have a problem when I want to set the TextBox to hidden I can't do it, it writes error CS0200 Property or indexer 'property' cannot be assigned to -- it is read only.
How can I set TextBox to hidden? I create WPF Application.

What I have tried:

C#
if (vybOp == 0 || vybOp == 2 || vybOp == 4 || vybOp == 6)
            {
                vysledekHrac.IsVisible = false;
            }



Thank you for any advice
Posted
Updated 10-May-21 1:09am
v2

1 solution

IsVisible is essentially a question not a property. Is this UI Element visible or not.

The property is Visibility. Try
C#
vysledekHrac.Visibility = Visibility.Collapsed;
or
C#
vysledekHrac.Visibility = Visibility.Hidden;
 
Share this answer
 
Comments
Member 15170612 10-May-21 7:25am    
thank you very much, it was easier than what i was afraid of
CHill60 10-May-21 7:53am    
Glad I could help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900