public class FormA //which would in reality be a form requiring an object containing data for displaying and modifying { CustomDataClass DataObject; public FormA(CustomDataClass MyCustomCreatedObject) { DataObject = MyCustomCreatedObject; } //with all other code related to the form... } public class FormB //which would in reality be a form requiring an object containing data for displaying and modifying { CustomDataClass DataObject; public FormB(CustomDataClass MyCustomCreatedObject) { DataObject = MyCustomCreatedObject; } //with all other code related to the form... } //... //However many forms I will be using... //... public class MainForm { CustomDataClass ApplicationData = new CustomDataClass(); //some code for populating the ApplicationData object with data etc... FormA FirstAdditionalForm = new FormA(ApplicationData); FormB SecondAdditionalForm = new FormB(ApplicationData); //until the number of required forms has been reached... //on a certain button click method in the MainForm: FirstAdditionalForm.ShowDalog(); //User does what is needed on the form and closes it... //on a certain button click method in the MainForm: SecondAdditionalForm.ShowDalog(); //User does what is needed on the form and closes it... }
public A
public FormA
public FormB
CustomDataClass
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)