If this needs to be done, don't modify the textboxes, subclass the VFP textboxes and change the subclassed copy (even go to next level and subclass a subclass). Then change the class of the textboxes so they inherit the changes. This is always my first lesson when I do tuition.
>(It can be worked around by saving the SelStart & SelLength values in the processing procedure & resetting in the GotFocus method - but that means modifying all textboxes & this is a customer requested mod. to an existing app. with quite a few forms & the action must be allowed for all text & edit boxes).