views:

132

answers:

1

I have 2 forms. A main one which has a richtextbox on (aswell as other stuff) and another which is used to find text in the richtxtbox on frm1. The second form consists of a textbox for the user to enter the word they are looking for, and 2 buttons. One for Find and one for Find next.

When the find button is selected the found text is highlighted in the main form (neither forms close) and if find next button is clicked the next item is found. (the next button is disabled if there isnt anymore text found)

Now problem is...i dont no how to code this!

+1  A: 

You will need to share the textbox with the Find form.

The simplest way to do this is to make the Find form's constructor take a RichTextBox parameter, and pass the textbox to it on the main form.
Then, make a field in the Find form to store the textbox, and set the field to the constructor parameter.

SLaks