Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditional selecting in the TextBox
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00785262
Message ID:
00786263
Views:
28
Hallo Marcia,

thank you for your reply. As a matter of fact, I've made a mistake describing my intentions: when the textbox is entered with the mouse it must be only (!) selected if the mouse click succeeded left to the filled part of a textbox. The background is: if the user clicks on the existing text - he must be able to edit it at once, otherwise the whole textbox must be selected and overwritten, but for the case when the allignment is left and the user clicks to the right of it and is probably going to add some text.

So I've modified your code in the following way:

instead of

IF BETWEEN( This.SelStart, 1, LEN( ALLTRIM( TRANSFORM( This.Value ) ) ) -1 )

I've made

IF BETWEEN( This.SelStart, 1, LEN(This.Text)-LEN( ALLTRIM(This.Text) ) )

But no matter which Code - it works only AFTER the focus is set, not when you get into the textbox from some other place. I wonder, at what moment is the SelStart really set?

By the way there is anothe issue, that I don't understand. If I have a textbox with Format "Z$999,999,999" and nothing in InputMask then the LEN(TEXT) is 18 (1). With InputMask "999,999,999" Len(This.Text) equals 13 (?)

The same textbox without anything in FORMAT or INPUTMASK has LEN(This.text) equal 16. What does it all mean?

Regards
Alexander Lerner
a_lerner@heinrich-schmid.de

The life is somewhat easier than it seems to be.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform