Página 1 de 1

TTreeView:OnKeyDown-two times

Publicado: Sab May 23, 2015 5:26 pm
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

Re: TTreeView:OnKeyDown-two times

Publicado: Lun May 25, 2015 10:27 am
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

Re: TTreeView:OnKeyDown-two times

Publicado: Lun May 25, 2015 7:44 pm
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