I have a C# WinForm application. On my Buttons I use the '&' (in the .Text properties) for
Hotkey access. The strange behavior is that
the '&' is converted to the appropriate underscore while
in design mode BUT DOES NOT appear at Runtime.

At runtime the Hotkey functionality works, but the
relevant underscores do not appear. For example, I have a
buttonSearch.Text = "&Search". At Runtime, the button
displays as "Search" and pressing "alt + S" triggers the event.

but the problem is that the underscore3 is not shown before i press alt !!!

Is this a bug? Or is there an obvious solution I have
overlooked. I do have KeyPreview = true.

i also want to set a tool tip !!

Any suggestions would be greatly appreciated!
Thanks,

This behaviur is the default. You can change it at Control Panel, Ease of Access Center, Make the keyboard easier to use, and check the option Underline keyboard shortcuts and access keys, then click on Save button, at each computer you want to change it.

no its not that settings !! since on other normal buttons it works !! it doesn't work only on ribbon controls !! bdw thanks for yr reply !!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.