Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to prevent some keypress's when focused to the grid
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
How to prevent some keypress's when focused to the grid
Divers
Thread ID:
00890459
Message ID:
00890459
Vues:
55
Hi All,

i've below codes on keypress event on my form.Normally these enough for navigation.when I use two tables (parent-child) i use Grid for child. i wantto prevent some keypress actions such as -1,-3,-5,-7,-8 when i focused to the grid and after wantto use normal out of grid. How should be codes ? and where to should i put them ? i've tried something on when-valid events but i couldnt success

TIA
* form keypress event
If Thisform.addmode=.F. Or Thisform.editmode=.F.
	Do Case
	Case nKeyCode=18 &&pgup
		oToolbar.cmdonceki.Click	&&This.onceki() &&prior
	Case nKeyCode=3 &&pgdn
		oToolbar.cmdsonraki.Click &&	This.sonraki() &&next
	Case nKeyCode=31 &&ctrl+pgup
		oToolbar.cmdilk.Click	&&This.ilk() &&first
	Case nKeyCode=30 &&ctrl+pgdn
		oToolbar.cmdson.Click &&	This.son() &&last
	Case nKeyCode=-1 &&f2
		oToolbar.cmdyeni.Click	&&This.yeni() &&new
	Case nKeyCode=-3 &&f4
		oToolbar.cmdduzelt.Click	&&This.duzelt() &&edit
	Case nKeyCode=-5 && f6
		oToolbar.cmdsil.Click	&&This.sil() &&delete
	Case nKeyCode=-7&& f8
		oToolbar.cmdbul.Click	&&This.bul() &&find
	Case nKeyCode=-8 && f9
		oToolbar.cmdyazdir.Click	&&This.yazdir() &&print-report
	Case nKeyCode=-9 && f10
		oToolbar.cmdcik.Click	&&This.cik() &&quit
	Case nKeyCode=27 &&esc
		Thisform.Release
Endcase
Endif

If Thisform.addmode=.T. Or  Thisform.editmode=.T.
	Do Case
	Case nKeyCode=-2 &&f3
		oToolbar.cmdkaydet.Click	&&This.kaydet() &&save
	Case nKeyCode=-4 && f5
		oToolbar.cmdvazgec.Click &&	This.vazgec() &&revert
	Endcase
Endif
on the grid i use only Ctrl+ins,Ctrl+Del,Ctrl+PgDn
*grid1 when
Thisform.LcAlias = this.recordsource
on Key Label ctrl+ins otoolbar.cmdsatirekle.Click()  &&addrow
On Key Label ctrl+del otoolbar.cmdsatirsil.Click() &&deleterow
On Key Label ctrl+dnarrow otoolbar.cmdsatirkopyala.Click() &&copyrow

* grid1 valid
thisform.LcAlias=this.linkmaster
on Key Label ctrl+ins  
On Key Label ctrl+del 
On Key Label ctrl+dnarrow 
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform