Display underscore (_) inside label in C #

Possible duplicate:
Disable WPF tag accelerator key (no underscore)

I am currently working on a C # WPF project. I need to read in the configuration file and display the parameters received inside the label. Parameters are sometimes indicated by an underscore (_) in the middle of the parameter name, for example, it may be something like my_option .

When I try to display my_option inside the label, the underline is hidden and is instead used as a keyboard shortcut when pressing the Alt key.

How can I disconnect this from the event and instead underline the underscore on the label?

I tried to do this so that it was my__option (i.e. adding two underscores together instead of one), but this does not seem to do anything.

+6
source share

Source: https://habr.com/ru/post/891362/


All Articles