Haha, what you're trying to do here, I've done in a few applications already, so I have a good idea of what you can do. To mention, since you are using a RichTextBox control, you can actually bold the text too. There is one application I wrote for managing a VB.net school, that allows me to manage templates in a 'rich-text' mode, and 'source-mode' with BBcode visible, and no formatting.
As for wrapping the text in BBcode tags. This is a simple task. :cool3:
Do you think it may be possible to overload that AppendText() method with more than one argument?
Overload? What do you mean? And with more than one argument... What kind of other arguments? You don't need to be doing that... The
SelectedText is a Get or Set property. That string is already stored somewhere (in the backing value for that property). Try selecting some text in that control, and having some code that changes that SelectedText to a new string:
Code:
richTextBox1.SelectedText = "$$$"
What you want is something like this:
Code:
richTextBox1.SelectedText = string.Format("[b]{0}[/b]", richTextBox1.SelectedText)
Note: I wrote that in C#, but to get it to VB.net, all I had to do here was remove the ";" at the end in this case lol.
Another way to check the selection is:
Code:
richTextBox1.SelectedText.Length > 0
And instead of "", remember you also have string.Empty :)