Search code examples
c#winformsrichtextboxmultiple-forms

c# richtextbox search with 2 forms


I've build an email app in c# winforms with a richtextbox. Now I want to add a search option, which opens in a new Window to enter the search/replace text. I know how to do this in one form, but how do i get access to the richtextbox in form1 from the second form?


Solution

  • In short, to have a form return values, one must give it public properties, and have them set by the form when closing.

    A more in-depth explanation and examples can be found here