Using this example by John Skeet, how can I get a messagebox to show the word? I have an event for when I want it to show, all I have to do is put in MessageBox.Show("WORD HERE")
string GetWord(
if (rtb.TextLength==0
return ""
string text = rtb.Text
int end = rtb.SelectionStart
int start = text.LastIndexOf (' ', end)
if (start==-1
start = 0
return text.Substring (start, end-start)