I don’t think you can do that with text boxes or text areas (I’m sure someone will shout if I’m wrong!).
I don’t know your use case, but you could accept their typing in a textbox and then transfer it to a richtextbox when they press enter, performing the replacement then.
Or, if you want that conversion in situ, then you could consider embedding an editor in your form. One example is :
and I think there are others if you search the forum.