Just to throw something else on the fire, you could use SP3 "on-the-fly" compilation to do this. (Why would you do it this way? "Because it's there.")
Put a call to a program in the textbox dbl-click event. It will be the same same so you never have to mess with the textbox code. As the environment which govers a mode changes, write out a new prg file. When the user dbl-clicks the textbox, the new program will compile and the new behavior will take effect.
The things you can do with VFP *g*.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao