-
Highlighted text...
Hi again.
I have a standard multi-line text box. I also have "B" command button, representing "Text Bold"
What I want to happen is the user highlights some text they've typed into my multi-line text box and then clicks B it adds <B> just before the start of their highlighting and </B> just after. I don't actually want the text to go bold... as it gets posted to a website.
I don't have the slightest idea of how to do this, could anyone help?
Thanks!
Jonathan.
-
maybe this can help ...
Code:
Dim str As String = TextBox1.Text
Dim SelectedStr = "<B>" & TextBox1.SelectedText & "</B>"
Dim startpos As Integer = TextBox1.SelectionStart
str = str.Remove(startpos, TextBox1.SelectionLength)
str = str.Insert(startpos, SelectedStr)
TextBox1.Text = str
-
Thanks! That worked perfectly!
:cool:
J.