我在写记事本查找时遇到了问题 请大家帮帮忙
private void MenuItemFindNextOne_Click(object sender, EventArgs e)
{
findText = richTextBoxContent.Text;
int start = richTextBoxContent.SelectionStart + richTextBoxContent.SelectionLength;
int end = richTextBoxContent.Text.Length;
if (!string.IsNullOrEmpty(findText))
{
int findIndex = richTextBoxContent.Find(findText, start, end, RichTextBoxFinds.MatchCase);//为什么此处findIndex 总是为-1
if (findIndex == -1)
{
MessageBox.Show("到达文件尾");
}
else
{
richTextBoxContent.Focus();
}
}
}
总感觉还有问题 请大家给完善一下