I'm busy building up a Web User Control that accepts some text input, and I need to include some basic text editing buttons to the control, something simular to the buttons on the message post page used here on CG.

I've spent the last few days searching CG and the net, but have not found a suitable solution..

To give an example of what i need to do ...

Think of making a post here, you highlight a section of text, and click the bold button, and the textbox now shows <B>some text</B>

Now preferably i'd like to do this on the client side (javascripts) however the scripts i have as samples do not link into my textbox or textarea controls.

I've also tried by using the postback method's and doing the editing on the serverside with VB, however neither the textbox or textarea controls have any methods resembling selectedtext or selectionstart, selectionlength, to allow me to identify the highlighted text and insert the required prefix and suffix.

Any help would be greatly apreciated..

Thanks.

Gremmy...