One (of many) ways you could use a common Form in the Main Form, and other secondary Forms, in a Windows Forms Apps is:
1. Define a public static property in the Main Form of Type 'CommonForm:
public static CommonForm TheCommonForm { private set; get; }
2. Assign an instance of 'CommonForm to the static public property ... in the Load EventHandler of the Main Form, for example:
private void MainForm_Load(object sender, EventArgs e)
{
TheCommonForm = new CommonForm();
}
3. When any Form needs to display the 'CommonForm"
MainForm.TheCommonForm.Show();
Then, of course, you will need to consider what elements/data/Controls you need to expose in the instance of 'CommonForm so that any Form which displays it can access what it needs to access.
If you need to pass custom data into the instance of 'CommonForm when you display it, you can define a custom 'Show operator like this:
private List<string> Data { set; get; }
public void Show(List<string> data = null)
{
if (data != null) Data = data;
base.Show();
}
In this brief example, any Form that displays the 'CommonForm can pass a List of string Type data in for internal use in 'CommonForm: if no data is passed in (Show called with 'null, or an empty List), then the internal 'Data list (if any) is left as-is.
If you wished the 'CommonForm to execute a query and then return query results to another Form, or Forms, that can be handled a number of ways, incluiding:
1. have the 'CommonForm define an Event to which any interested Form can subscribe, with that Event returning query results in a custom Class inheriting from EventArgument, or other data structure.
2. pass a data structure by reference to the 'CommonForm, and use the modified data structure after it is handled by 'CommonForm.
Again, there are many ways you might go about this, and without knowing your scenario in more detail, the example here cannot claim to be "best practice."