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.

TTreeView:OnKeyDown-two times

Xailer English public forum
Responder
Avatar de Usuario
Hurricane
Mensajes: 262
Registrado: Mar Mar 24, 2015 10:21 am
Ubicación: Brasil
Contactar:

TTreeView:OnKeyDown-two times

Mensaje por Hurricane »

Hi Ignacio,

When pressing F3, performs two times. This is a bug, right?

Código: Seleccionar todo

METHOD TreeView2KeyDown( oSender, nVKey ) CLASS TForm2
   if nVKey = VK_F3
      MsgInfo('F3')
   endif
   
RETURN Nil
executes one time, correct!

Código: Seleccionar todo

METHOD TreeView2KeyUp( oSender, nKey, nFlags ) CLASS TForm2
   if nKey = VK_F4
      MsgInfo('F4')
   endif

RETURN Nil
Developments | Trainings | Projects
Site | E-mail | Messenger | YouTube
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9253
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: TTreeView:OnKeyDown-two times

Mensaje por ignacio »

Since the method is overloaded by more than one ancestor this is normal to happen. BTW, you just need to RETURN 0 instead of NIL
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Avatar de Usuario
Hurricane
Mensajes: 262
Registrado: Mar Mar 24, 2015 10:21 am
Ubicación: Brasil
Contactar:

Re: TTreeView:OnKeyDown-two times

Mensaje por Hurricane »

Now it works. Thanks for your help.

Código: Seleccionar todo

METHOD TreeView1KeyDown( oSender, nVKey ) CLASS TForm2
   if nVKey = VK_F3
      frmMain()
      return 0 // Required
   endif

   RETURN nil  // Required if not done anything.
ignacio escribió:Since the method is overloaded by more than one ancestor this is normal to happen. BTW, you just need to RETURN 0 instead of NIL
Responder