Assaf Cohen
Assaf Cohen

Reputation: 41

Adding an extra property to WPF TextBox class

I a trying to change the TextBox wpf control so that it would include an extra property (a string). Is it possible to change an existing control? Would it be possible to create a new control that inherits from TextBox?

Upvotes: 0

Views: 821

Answers (1)

Praveen Paulose
Praveen Paulose

Reputation: 5771

You cannot add an extra property to the TextBox control. You can however inherit from the TextBox control and make your own control. Add your extra properties in your custom control.

Having said that, if you have a single property that you require, you can always use the Tag property for your custom requirements.

Upvotes: 1

Related Questions