In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Tab order, and shortcut/hot keys

Xailer professional forum in English
Responder
DC
Mensajes: 75
Registrado: Lun May 16, 2011 6:06 pm

Tab order, and shortcut/hot keys

Mensaje por DC »

Hi,

Two questions and a subquestion

1) Other than Arrange Controls, is there a way to specify the tab order? Like this edit box is number 1, this button is 2nd, etc.?

2) How do we assign shortcut keys to Edit boxes and buttons?
2a) Is it possible to assign a single digit as a shortcut key, in order to make an Edit box active?
In other words, while the entire form is in focus, you type the number 1, and then the edit box becomes active and the shortcut keys become inactive. As soon as you exit the edit box and give the form focus, the shortcut keys become active again.
Is that possible?
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5653
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Re: Tab order, and shortcut/hot keys

Mensaje por jfgimenez »

Hi Dwayne,

1) No, sorry.

2) For buttons and other controls which have a "caption" or cText, use the & character just before the desired char. F.e. "Button &1".
For other controls like edits, you must set the shortcut to the previous control which cannot be focused (usually a TLabel).

2a) See the property lDirectShortCuts from TForm. It allows to use the shortcut without pressing the "alt" key. But, it catches also keystrokes sent to edit controls, so you have to avoid it. I've attached a working sample that override the form's WMChar() method.
Adjuntos
Controls.zip
(2.3 KiB) Descargado 15 veces
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
DC
Mensajes: 75
Registrado: Lun May 16, 2011 6:06 pm

Re: Tab order, and shortcut/hot keys

Mensaje por DC »

Thanks, Jose.
Responder