Groups | Blog | Home
all groups > dotnet compact framework > march 2005 >

dotnet compact framework : Mnemonic/Accelerator Character in Button Text?


josepk NO[at]SPAM hotmail.com
3/6/2005 4:17:46 PM
Hello,

Is there a way to display a mnemonic character in a button's text
property? For example, "&Login" would translate to "Login" with an
underscore under the "L".

I know this is not supported natively in the CF but wondering if
someone has found a workaround.

Thanks,

Joe
Sitar
3/7/2005 8:51:02 AM
Yes there is:
myLoginButton.Text = "&Login";

works perfectly fine with me. The only problem is you can press ALT+L until
the cows go home. It won't work. I had to implement myself a KeyDown even to
handle it.

Cheers,
Sitar.


[quoted text, click to view]
Sitar
3/7/2005 8:53:02 AM

Maybe I should have mentionned that I have CF SP3. I never tried it with
SP2. But the mnemonic character is "underscored" with SP3 at least.

Cheers,
Sitar.
Paul G. Tobey [eMVP]
3/7/2005 9:30:05 AM
I haven't done this, but you could use ApplicationEx and an IMessageFilter
from OpenNETCF and catch key combinations like Alt+<whatever> and then,
iterate through the controls on the current form, which you'd also have to
keep track of, and find the one that should be activated.

Paul T.

[quoted text, click to view]

AddThis Social Bookmark Button