Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting trailing spaces in textbox control
Message
 
 
To
30/03/2001 16:00:36
Jill Derickson
Software Specialties
Saipan, CNMI
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00489758
Message ID:
00490489
Views:
9
>Hi Nadya,
>
>Thanks, but I don't think that would be sufficient either. What if the user clicks somewhere other than at the end of the string and presses Delete or Backspace (within trailing spaces or not)? what if a number of characters are highlighted and the user presses Delete or Backspace?

Haven't thought about it :( Now you have to play with SelStart, SelLength, SetText...
>
>I'm spending WAY too much time on this, but I'm back to collecting printable characters as the user types them, into a string - and processing non-printable characters, as appropriate. I think, when I went to bed last night, that I was mostly there. Will have to work on it more today.
>
>Thanks for your help and support on this!
>
>> Basically, it's a little addition to the existing code:
>>Pseudocode
>>if keycode=code(delete) or keycode=code(backspace) and .LastSymbolWasSpace
>>    .NumberOfTralingSpaces=.NumberOfTralingSpaces-1
>>    .LastSymbolWasSpace=(.NumberOfTralingSpaces>0)
>>endif
>
>
>>>> What about initialization this control as space(30) by default?
>>>what would that do for me?
>>>
>>Just thought, may be it will help? :)
>
>Thanks...doesn't seem to matter WHAT I initialize it to.
>
>J
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