Reputation: 55
Hello everyone what I'm trying is in wpf to make that user cant type in textbox. I know there is way just to make it isEnabled = False but if i use it my textbox gets grey color and i cant make it without background! So is there anyway to forbid user entering any char in textbox or any other way? Please help
Upvotes: 0
Views: 148
Reputation: 177
Did you want to dynamically change when the textbox is editable or is it always going to be un-editable? You might consider using a label instead if this is the case. If its dynamic you probably want the backcolor to change to let the user know this is the case.
Upvotes: 0
Reputation: 155145
Use the TextBox.IsReadOnly
property: http://msdn.microsoft.com/en-us/library/ms753374.aspx
Upvotes: 1