Groups | Blog | Home
all groups > dotnet windows forms > february 2005 >

dotnet windows forms : UseMnemonic


Siu
2/14/2005 12:17:03 AM
Hi,
does a property UseMnemonic exist for a Button control?? I've created a
button with this property:

Button.Text = "&Add new record";
Button.Name = "btnMyButton";

The & should allow a easy access with the keyboards... but it doesn't work:
with Label is easy thanks to the UseMnemonic property, but how about Button
control? Does it exist something similar?

Siu
2/14/2005 2:21:05 AM
Thanks,
I was convinced that I could access the button by touching the key Ctrl+A
instead of Alt+A

Thank you again


[quoted text, click to view]
Morten Wennevik
2/14/2005 10:48:41 AM
Hi Siu,

Buttons don't have the UseMnemonic property, but they still have the
behaviour you want.

Your button should have a line under A. It should respond to [ALT]+[A]
and trigger a Click event. (Note that you need to attach a click event to
the button or nothing will happen)

--
Happy Coding!
AddThis Social Bookmark Button