I have a Rich textbox and have some text in it, What im trying to do is when the user selects text and clicks a button it will replace that selected text with something like <tag>{selected text}</tag> How would i do this?
EDIT--------------------------------------------------------------------
Ok well i got what i wanted after playing around with the code for a while,
But if anyone knows a better way, Please do tell me.
EDIT--------------------------------------------------------------------
Ok well i got what i wanted after playing around with the code for a while,
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
codebox.Copy()
tmptext.Paste()
formattext.Text = "<b>" + tmptext.Text + "</b>"
formattext.Select()
formattext.Copy()
codebox.Paste()
formattext.Clear()
tmptext.Clear()
End Sub
But if anyone knows a better way, Please do tell me.
Last edited: