Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why am I getting kicked out of this textbox? Please...
Message
De
01/11/2004 15:29:05
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Why am I getting kicked out of this textbox? Please...
Divers
Thread ID:
00956695
Message ID:
00956695
Vues:
61
Hi,

I hope somebody else can see why I am unexpectedly losing focus on the textbox which has the following code in its KEYPRESS method:
LPARAMETERS nKeyCode, nShiftAltCtrl
lcAlias = 'inventory'
lcField = 'upname'

if nKeycode = 127
    if empty(this.value)
         nodefault
    endif
endif


IF empty(this.Text)
	keyval=Seek(UPPER(Chr(nKeyCode)),lcAlias,lcField)		
else
	keyval=Seek(UPPER(subs(This.Text,1,This.SelStart)+Chr(nKeyCode)),lcAlias,lcField)
ENDIF
_name = inventory.name



If keyval
	nCurPos = This.SelStart + 1
	This.Value = _name
	This.SelStart = nCurPos
	If Len(Allt(_name)) - nCurPos > 0
		This.SelLength = Len(Allt(_name)) - nCurPos
	ENDIF
 
	Nodefault

ENDIF
The bizarre thing is that it works as I expect it to for a few times, then on the third or fourth invocation I will suddenly have the LOSTFOCUS method fire, although I am only pressing the normal alphanumeric fields.

Any ideas?
On a CLEAR day you can see forever.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform