I have a small project im working on and i cant seem to figure out one thing, how do i insert text AT THE CURSOR into a text box.

simple example:

lets say i have a text box that reads:

"Hello, welcome to my program!"

and the cursor is right betwteen the word Hello and the comma, and i want a button that will insert text at the cursor (such as a name in this instance).

i know it will involve breaking the text box contents into a string before the cursor point and a string after the cursor point then sticking a string in between and cancatonating it all together but i cant figure out how to get the cursor position.

any help would be appreiciated, thanks in advance'

-glitch13