My Label.Content
in WPF doesn\'t display the first occurrence of \"_\" character. Why?
Use of TextBlock to solve this issue comes with some disadvantages, such as the inability to center the content vertically (save for placing it within a grid, and there are many situations where the requisite additional controls may be undesirable). In my case, I created a TextBox that behaves like a Label using the following code:
var fauxLabel = new TextBox();
fauxLabel.Cursor = Cursors.Arrow; // Avoid the IBeam mouse cursor when hovering
fauxLabel.Background = Brushes.Transparent;
fauxLabel.BorderThickness = new Thickness(0.0, 0.0, 0.0, 0.0);
fauxLabel.Focusable = false;