Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Some Help About Numeric TextBox Class
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Need Some Help About Numeric TextBox Class
Divers
Thread ID:
01114408
Message ID:
01114408
Vues:
61
Hi All,
i need some help about numeric textbox class , it works and enough me but wantto also this
when i gotfocus to the textbox and press some keys between 0-9 old value will be 0 and start and continiue new typed values
i'tried some ways but was not succesfull

here is my code below

Any advice would be appreciated.

TIA
**************************************************
*-- Class:        stb_txtnumber2 (c:\soykan\mysoftware\emin_elk\lib\soykan.vcx)
*-- ParentClass:  textbox
*-- BaseClass:    textbox
*-- Time Stamp:   04/18/06 05:02:00 PM
*
DEFINE CLASS stb_txtnumber2 AS textbox


	Alignment = 1
	Value = 0
	Height = 23
	InputMask = "999,999,999.99"
	Width = 100
	Name = "stb_txtnumber2"


	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		Do Case
		Case nKeyCode=7   && del
			This.Value = 0
			This.Refresh
		Case nKeyCode >= 48 And nKeyCode <= 57
		* Digits 0 to 9
		* need something to here
		Endcase
	ENDPROC


	PROCEDURE LostFocus
		This.BackColor= 16777215
	ENDPROC


	PROCEDURE GotFocus
		With This
			.Tag=Transform(.Value)
			.BackColor= Rgb(255,255,192)
			.Refresh
		Endwith
	ENDPROC


	PROCEDURE InteractiveChange
		_vfp.ActiveForm.changed = .t. 
		_vfp.ActiveForm.addmode = .t. 
		_vfp.ActiveForm.editmode = .t. 
		this.BackColor= 8421631
	ENDPROC


ENDDEFINE
*
*-- EndDefine: stb_txtnumber2
**************************************************
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform