3
Answers

Finding

Ryan Turney

Ryan Turney

17y
2.6k
1

Hello, I am having problems with creating find function. I can get the code to find starting from the top going down, but I haven't been able to reverse that, take a look.

 

else if (upRadioButton.Checked == true)

{

   try

   {

      rtb.Select(rtb.Text.Length, length);

      // rtb.Select(searchindex - 1, length);

      searchindex = temp.LastIndexOf(textBox1.Text, searchindex);

      rtb.Select(searchindex, length);

      rtb.Focus();

      searchindex += length;

      }

   catch (Exception e)

   {

      MessageBox.Show(e.Message);

   }

}

 

Thanks for any help you can give, this should be simple. I'm just having a "I don't get it day".

Answers (3)