如何在TextBox中选择一个单词并在C#中更改其颜色

时间:2016-12-09 17:00:02

标签: c#

如何在文本框中选择错误拼写单词并更改其颜色?

if (!SuggestStrings(char.ToLower(t.Text[Tempindex - 1]), Dic, First, Last))
                        {
                            //Search.SelectionStart = indexSentence - indexWord;
                            //Search.SelectionLength = indexWord;
                            Search.Text.Substring(indexSentence - indexWord, indexWord);
                            Search.Font = new Font("Microsoft Sans Serif", 11, FontStyle.Underline);
                            Search.ForeColor = Color.Red;
                            t.SelectionLength = 0;
                            foundWord = false;



               }

0 个答案:

没有答案