Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
STRTRANS and Slashes
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01274617
Message ID:
01274634
Vues:
11
Well, making it more complicated just so not to use variables <g>
loForm			= Createobject('myForm')
loForm.Show(1)

define class myForm as Form
	add object myTextBox as Textbox

	procedure myTextBox.KeyPress(nKeyCode, nShiftAltCtrl)

		nodefault
		if nKeyCode # 92 or At('\', this.Value) = 0
			Dodefault(nKeyCode, nShiftAltCtrl)				
			if ((nKeyCode = 92) or (nKeyCode = 127 and substr(this.Value, this.SelStart, 1) == '\' and substr(this.Value, this.SelStart - 1, 2) # '\\')) and nShiftAltCtrl = 0
				Dodefault(nKeyCode, nShiftAltCtrl)
			endif
		endif

	endproc

enddefine
[Update] By the way, I realize that you can still press DEL or select text and then overwrite/delete, but do not feel like adding more code, after all this might not even be what Jay needs, maybe I completely misunderstood him.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform