Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting trailing spaces in textbox control
Message
From
30/03/2001 08:43:53
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00489758
Message ID:
00490288
Views:
13
Hi Jill,

I have an idea which may work. In the GotFocus event of the textbox, say:

this.value=repl(chr(10),17)
=insm(.f.)

In the KeyPress event, say:

if nkeycode=7 or nkeycode=127
this.value=trim(this.value)+chr(10)
endif

In the Valid event, say:

=insm(.t.)

I am using a double-byte character version of VFP6 and chr(10) works. In Enlish verson, chr(10) may not work, in which case you may have to use a different character which is not visible and is not expected to be keyed in. The textbox's SelectOnEntry should be set to .f.

BTW, the length of value (17) is dependent on the lenth of the textbox and its font size, unless the MaxLength is given.

CY
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform