What is the difference between the WPF TextBlock element and Label control? [duplicate]

The WPF Textblock inherits from FrameworkElement instead of deriving from System.Windows.Control like the Label Control. This means that the Textblock is much more lightweight. The downside of using a textblock is no support for Access/Accerelator Keys and there is no link to other controls as target.

When you want to display text by itself use the TextBlock. The benefit is a light, performant way to display text.

When you want to associate text with another control like a TextBox use the Label control. The benefits are access keys and references to target control.

Leave a Comment