Reputation: 71
How can I change all TextBox
es to Label
s when a button is clicked?
Upvotes: 0
Views: 618
Reputation: 14432
You could do as @devdigital said, which is a correct solution. What you also could do is set the IsReadOnly property to true. This way you achieve the same as when disabling the TextBox, but instead you don't get an ugly grayed-out one where you cannot select the Text/Content from the TextBox.
Upvotes: 1
Reputation: 34359
You would be better setting them all to disabled (IsEnabled = false
) or read only (IsReadOnly = true
), and changing the TextBox
style to suit your needs.
There are some examples here for changing the style of a TextBox
.
Upvotes: 1