Accelerator keys for button controls

G

Guest

I have a problem with accelerator keys for button controls on my vb.net project (Windows forms)

Accelerator shortcuts (ampersand) in .text property do not seem to work with Button controls. They appear to work OK, however, with textboxes. With buttons, when running the application the underlined character shows up OK, but pressing Alt and that character (just a letter P, in this case) does not cause the cursor to navigate to the button (or anywhere at all).
Yet this works fine with textbox controls, that have an adjacent label control

Anyone know if this is a common problem and what to do about it

Thanks
 
H

Herfried K. Wagner [MVP]

* =?Utf-8?B?SWFu?= said:
Accelerator shortcuts (ampersand) in .text property do not seem to
work with Button controls. They appear to work OK, however, with
textboxes. With buttons, when running the application the underlined
character shows up OK, but pressing Alt and that character (just a
letter P, in this case) does not cause the cursor to navigate to the
button (or anywhere at all).

Right. It will only call the button's 'Click' event handler, but it
won't set the cursor to the button. This behavior is common for Windows
UIs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top