[开源]查找
<P>新建Windows应用程序,拖入richTextBox和textBox及button控件<BR>将richTextBox属性设置如下:<BR>AutoWordSelection:True</P><P>HideSelection:False</P>
<P>然后加入代码如下:<BR><BR> private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)<BR> {<BR> int i=richTextBox1->Find<BR> (textBox1->Text,System::Windows::Forms::RichTextBoxFinds::None);<BR> if(i>=0)<BR> {<BR> richTextBox1->Select(i,textBox1->Text->Length);<BR> }<BR> else<BR> {<BR> MessageBox::Show("没有找到符合的文本");<BR> }<BR> }</P>
<P> };</P>
页:
[1]
