Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
KeyPress method - skip the class code
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01668315
Message ID:
01668316
Vues:
75
This message has been marked as a message which has helped to the initial question of the thread.
Hi Naomi,

Try...
loo=CREATEOBJECT("_FormExEx")
loo.AddObject("txt1", "Textbox")
loo.txt1.Visible=.t.
loo.Visible=.t.

SUSP

DEFINE CLASS _Form AS FORM
   Name="_Form"
   KeyPreview=.T.
   
   PROCEDURE KeyPress
     LPARAMETERS nKeyCode, nShiftAltCtrl
     DEBUGOUT "_Form","KeyPress"
  ENDPROC

ENDDEFINE


DEFINE CLASS _FormEx AS _Form
   Name="_FormEx"
   
   PROCEDURE KeyPress
     LPARAMETERS nKeyCode, nShiftAltCtrl
     DEBUGOUT "_FormEx","KeyPress"
     DODEFAULT()
  ENDPROC

ENDDEFINE


DEFINE CLASS _FormExEx AS _FormEx
   Name="_FormExEx"
   
   PROCEDURE KeyPress
     LPARAMETERS nKeyCode, nShiftAltCtrl
     DEBUGOUT "_FormExEx","KeyPress"
     
     LOCAL m.liClassCNT
     LOCAL ARRAY m.laClass(1)
     m.liClassCNT=ACLASS(m.laClass, This)
     =EVALUATE(m.laClass(MIN(1+2, m.liClassCNT))+"::KeyPress(nKeyCode, nShiftAltCtrl)")
     RETURN
  ENDPROC

ENDDEFINE
MartinaJ

>Hi everybody,
>
>I have a form's class with KeyPress method code. I have a form based on that form's class where I don't want to execute parent's class method. I added NODEFAULT in the KeyPress event and found that pressing keys in that form didn't do anything (e.g. input controls stopped operations).
>
>So, how can I have normal operation of KeyPress but prevent class method's to execute?
>
>Thanks in advance.
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform