Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Format property in Grid
Message
 
 
To
02/12/2001 21:22:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00588342
Message ID:
00588700
Views:
27
>>Of the top of my head:
>>put the following code in Click event:
>>
>>this.SelStart=0
>>this.SelLength=len(this.value) && if field character, otherwise len(transform(this.value))
>
>Nadya,
>
>Thanks, you gave me one solution that when the old value for ie. 2000 and I want to replace it with 1000, the changes will not gonna be 1000000 (the digit 2 is replace by 0 (the last zero from 1000)) but the old value 2000 stil there.
>Can you give me any idea how to clear it as we want to make changes ?
>
>TIA
>
>Budianto

Hi Budianto,

Ok, here is another idea:

Either add a new property to your text class, called OldValue, or use Tag property, which is less convenient.

In GotFocus this.OldValue=this.Value
In Click
blank field (this.ControlSource)

In LostFocus:
if isBlank(this.value)
   this.value = this.OldValue
endif
This is of the top of my head and not tested.

I'm also not 100% sure, user would like to have nothing in the field, if it's clicked. What if he/she clicks by mistake and not with the intention of changing?

My first solution just selects everything in the textbox, so user can hit Del button and type anything he/she wants...
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform