Information générale
Catégorie:
Codage, syntaxe et commandes
Bob-
>I have a few labels, I use as buttons. I set the captions, and in the click event I put some code, to launch code.
>
>the captions, I just added a \< to enable hot keys. I can hot key to the label, (the color changes, a little,) but to actually get it to do anything I have to use the mouse click.
Right. Label's don't get focus. The reason we put accelerator keys on labels is because when the keystroke fires, since the label can't get focus, the next control in the tab order receives the focus.
>Since there is not a keypress method on the label control ... and I have not found a way to put one there. I am stuck.
I think Iain's suggestion is the correct one for you.
>But I find it strange you can hot key to a label.caption, but can't get it to activiate the click method.
It has to be this way. Since we really want an accelerator key to work on control that can do things, and since those controls don't have captions that the user can see, we need the two elements.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement