关于记事本的问题 记事本编辑菜单项的查找用C#怎么实现啊,大虾们,帮帮忙啊!界面做好了,不知道该怎么实现啊! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 int s = this.textBox1.SelectionStart; if (this.textBox1.SelectedText == "要查找的内容") { s++; } int result = this.textBox1.Text.IndexOf("要查找的内容", s); if (result >= 0) { this.textBox1.SelectionStart = s; this.textBox1.SelectionLength = "要查找的内容".Length; this.textBox1.ScrollToCaret(); } else { MessageBox.Show("没找着"); } 修正一下:int s = this.textBox1.SelectionStart; if (this.textBox1.SelectedText == "要查找的内容") { s++; } int result = this.textBox1.Text.IndexOf("要查找的内容", s); if (result >= 0) { this.textBox1.SelectionStart = result; this.textBox1.SelectionLength = "要查找的内容".Length; this.textBox1.ScrollToCaret(); } else { MessageBox.Show("没找着"); } C# winform程序得到当前所有窗体 socket如何相互发送消息? 如何做浮动页面 动态绑定 面包屑控件.... 高分求个Csharpdevelopment编译器 提供个下载地址就行了! 高手怎么处理单元格? C# winform程序,一个窗体中两个定时器的配合使用问题。 用读webBrowser1,怎么执行选择 上海? 请问用C#打开word文档的问题(ComException错误,无法打开宏存储) C#中如何取得dataset对象中所储table的某行某列值? [讨论].net架构与j2ee架构之比较 关于软件工程师的问题
if (this.textBox1.SelectedText == "要查找的内容")
{
s++;
}
int result = this.textBox1.Text.IndexOf("要查找的内容", s);
if (result >= 0)
{
this.textBox1.SelectionStart = s;
this.textBox1.SelectionLength = "要查找的内容".Length;
this.textBox1.ScrollToCaret();
}
else
{
MessageBox.Show("没找着");
}
int s = this.textBox1.SelectionStart;
if (this.textBox1.SelectedText == "要查找的内容")
{
s++;
}
int result = this.textBox1.Text.IndexOf("要查找的内容", s);
if (result >= 0)
{
this.textBox1.SelectionStart = result;
this.textBox1.SelectionLength = "要查找的内容".Length;
this.textBox1.ScrollToCaret();
}
else
{
MessageBox.Show("没找着");
}