Why does ToolStripStatusLabel not have a UseMnemonic property?

  • Thread starter Thread starter Lloyd Sheen
  • Start date Start date
L

Lloyd Sheen

I really don't get it. Labels have it for a reason and the
ToolStripStatusLabel is just a label in a StatusStrip.

Is there any way around this. I have lots of data which when displayed
looses the "&" in the text. I have no control on what is to be displayed
because that is the data's content.

I understand about the & but since the label has it why not ....


LS
 
Lloyd said:
I really don't get it. Labels have it for a reason and the
ToolStripStatusLabel is just a label in a StatusStrip.

Is there any way around this. I have lots of data which when
displayed looses the "&" in the text. I have no control on what is
to be displayed because that is the data's content.

I understand about the & but since the label has it why not ....

With a normal Label, the & is there to display the hotkey for the next
control that can get the focus. A StatusStrip (AFAIK) can not get the focus.
Probably therefore, there is no UseMnemonic property.

Replace all "&" by "&&" and you'll get the desired display.
The DrawTextEx API function that is probably used to draw the labels,
processes the prefix characters by default. This must be turned off
explicitly if you want the original text to be displayed, but obviously the
Framework doesn't do it, and AFAIK there's no property to turn it off by
code.

DrawTextEx (DT_NOPREFIX flag):
http://msdn.microsoft.com/en-us/library/ms534007(VS.85).aspx


Armin
 
Back
Top