Here's how I'd do it.
In the Command Window:
CREATE CLASS
In the dialog that appears, give your new class a name. In this case, maybe something like txtAddAtRuntime. In addition, specify the name of the class library where you want to store this class. I gather you don't have any class libraries yet, so you just need to specify a folder and file name. VFP will add a VCX extension. Click OK.
The Class Designer opens up. Here you can write any code that should apply to every textbox of this class, as well as change any properties (such as Width and Height). You can also add custom properties and methods to do things that aren't built into textboxes. In the code you write, use THIS to refer to the textbox itself.
When you've made all your changes, save and close the Class Designer.
Now, in your form where you want to add one of these textboxes, instead of using:
ThisForm.AddObject("myNewTextBox", "TextBox")
use:
ThisForm.NewObject("myNewTextBox", "txtAddAtRuntime", "YourClassLib")
and presto, the newly added textbox will have all the code you need available.
All that said, why do you need to add textboxes at runtime?
Tamar