>< snip >
>>If doesn't seem to work. For instance, I have a textbox with controlsource BldMstr.Page (it's an integer field). I set MaxLength to 2 (for testing sake), but it still allows me to type 7 digits.
>>
>>I tried the following code in textbox InteractiveChange:
>>
>>if len(alltrim(this.text))>this.MaxLength
>> nodefault
>>endif
>>
>>But it doesn't work either.
>>
>>What else can I do? May be set confirm ON in interactive change? (Back to off in GotFocus)?
>
>From VFP help:
>
MaxLength only applies for a text box when MaxLength is greater than 0, the text box does not use the InputMask property, and its Value property is of character type.>
>Checking on Keypress event? InputMask?
Ok, just found, that my solution doesn't work.
If anyone knows, how to solve this problem?
BTW, another strange thing I noticed: if I paste some text in the field (Ctrl+V), the KeyPress of this field is no longer firing even if I try to change some letters...
If it's not broken, fix it until it is.
My Blog