I have a winforms application where i have one main form in which i have a panel that i use to display the application's other forms. For example... Form1 is the main form. On Form1 there is a panel called "childFormPanel" and 3 buttons to load either Form2, Form3, or Form4 into the panel. When you click any of these buttons, whatever form is currently loaded in the childFormPanel is hidden and that form is then loaded into the Panel.

Currently, each of the child forms have their own search textbox that a user can enter text into and search a datagrid that the child form holds. What i would like to do instead, is have just one search textbox that lives on the main form that can pass the text to whatever form is currently loaded into it's panel.

I am not loading the forms using ShowDialog for various reasons and i'm not closing them out and creating a new instance of the form every time but instead hiding/showing them. Not sure that's relevant but thought i'd include it. I've gotten the hang of passing data from a child form to a parent, but not necessarily the other way around.

What is the best way to go about having one textbox on a main form that can pass data to whatever child form is loaded?

Any tips/ideas are appreciated!