Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tab on a Page Frame
Message
 
 
À
01/08/2001 14:16:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00538420
Message ID:
00538733
Vues:
9
>I agree, so how do I remove the functionality?

Hi!

Nodefault suggested here will prevent from tabbing out from first or last control. The aproach below is more generic and will allow you to organize tabbing like if there are no way to tab into the pageframe header.

In the KeyPress event of the first control in TAB order and Last control in tab order put code:
LPARAMETERS nKeyCode, nShiftAltCtrl
thisform.ShiftTab = (nKeyCode = 15) and BITTEST(nShiftAltCtrl,0)
Than add ShiftTab proeprty to the form (you can also add it to the base text box class for more generic case). In the Valid event of the first control put
return iif(thisform.ShiftTab,2,1)
In the Valid of last control put
return iif(thisform.ShiftTab,1,2)
Above will assure tab is not selected either by TAB or SHIFT+TAB.

If the first or last control has no Valid event, you can use the LostFocus event of that control. However, instead of returning 2 from Valid event, use 'KEYBOARD "{TAB}"' command in the LostFocus event for last control so additional Tab will tab out immediately from the pageframe tab. For first control, use direct SetFocus to last control on form because KEYBOARD "{SHIFT+TAB}" do not work as exected in VFP. In other words, for first control LostFocus event will be like following:
if thisform.ShiftTab
	this.parent.Text2.SetFOcus
endif
and for last control:
if !thisform.ShiftTab
	this.parent.Text1.SetFOcus
endif
or
if !thisform.ShiftTab
	KEYBOARD "{TAB}"
endif
HTH.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform