Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   OOP (https://www.clubdelphi.com/foros/forumdisplay.php?f=5)
-   -   KeyPreview en Forma cuyo Parent es un Panel (https://www.clubdelphi.com/foros/showthread.php?t=32469)

samantha jones 07-06-2006 00:19:04

KeyPreview en Forma cuyo Parent es un Panel
 
Hola a tod@s,

Tengo una App en donde creo dinámicamente una forma("x") dentro de un TPanel, mi problema es que en la forma "x" tengo el keypreview=true y en la forma del Panel también, el evento onkeyup que prevalece es el de la forma del panel.... ¿Como le hago para poder utilizar el OnKeyUp de la Forma "x"?

Saludos
Samantha

vtdeleon 07-06-2006 00:50:01

Desactiva el keypreview del Form Panel, cuando necesites usar el key de la forma x.

Yo no alcanzo a entender porque tenerlo activado en ambos.

samantha jones 07-06-2006 01:10:43

Deshabilite el KeyPreview de la forma del panel y sigue sin reconocer el OnKeyUp de la forma "X"... Alguna Idea?

Yosuun 07-06-2006 16:25:13

Prueba utilizando el componente de applicationeventes e interceptando ONMEssage

Código Delphi [-]
 
  If Msg.message = WM_KEYDOWN Then
     Begin
       If Msg.wParam = VK_Decimal Then
          Begin
            If Screen.ActiveControl is TDBEDIT Then
               Begin
                 IF (Screen.ActiveControl as TDBEDIT).Field.DataType=ftFloat     Then Msg.wParam:=188;
               End;
            If Screen.ActiveControl is TRxDBCalcEDIT Then
               Begin
                 IF (Screen.ActiveControl as TRxDbCalcEDIT).Field.DataType=ftFloat Then Msg.wParam:=188;
               End;
          End;
       If Msg.wParam = VK_Escape Then
          BEgin
             Screen.ActiveForm.Close;
          End;
       If ( (Msg.wParam=VK_RETURN) or
            (Msg.wParam=VK_UP) or
            (Msg.wParam=VK_DOWN) ) and not (Screen.ActiveControl is TButton)
                            and not (Screen.ActiveControl is TRxDBGrid)
                            and not (Screen.ActiveControl is TDBGrid) Then
          Begin
            If (Msg.wParam=VK_RETURN) Then
               Begin
                 Msg.wParam:=0;
                 Screen.ActiveForm.PerForm(WM_NextDlgCtl,0,0);
               End;
            If (Msg.wParam=VK_DOWN) Then
               Begin
                 Msg.wParam:=0;
                 Screen.ActiveForm.PerForm(WM_NextDlgCtl,0,0);
               End;
            If (Msg.wParam=VK_UP) Then
               Begin
                 Msg.wParam:=0;
                 Screen.ActiveForm.PerForm(WM_NextDlgCtl,1,0);
               End;
          End;
     End;


Espero que te sea de ayuda un saludo.


La franja horaria es GMT +2. Ahora son las 08:35:49.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi