Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine Significant Trailing Spaces in controls
Message
 
 
To
01/08/2007 18:05:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01245320
Message ID:
01245343
Views:
21
>I have a need to determine if trailing spaces have been entered into a textbox or a combobox by the user. If the user adds trailing spaces, then these are significant and part of the text expression. Normally the .Value property (or .DisplayValue) has the text padded with spaces to the full size allowed. I only want trailing spaces if they are entered by the user.
>
>I know I can trap the keystrokes and increment a counter if a SPACE is entered (reset if any other character entered), But I wonder if anyone has already "invented" this and has a ready solution. Thanks.

BTW, I forgot to answer your question. Actually I learnt the answer just recently by the interesting coincidence. See Christof's answer at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1941254&SiteID=1

Here is it:

If you don't specify a ControlSource, nor an InputMask or a MaxLength value, then VFP uses the textbox width and the average character width to calculate the maximum number of characters you can enter into a textbox. If you want more than 30 characters you have to specify an InputMask or set MaxLength.


Looks like this question was in a different thread (may be the one I pointed you to). Anyway, would not hurt to put it here :)
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform