I need some help with C#.
Let's say I have 3 classes. MainMenu, Form1 and Data. I have created an instance of Data (referenced as StoreData) in MainMenu.
public partial class MainMenu : Form
{
public Data StoreData = new Data();
}
I want to be able to access this instance of StoreData in Form1. How do I reference it or import it?

If you want to reference one class within another class (and don't want to make anything
static), composition is one way to go.You want to reference field of
MainForminForm1, so you want to referenceMainFormitself. Thus, you need to create field inForm1ofMainFormtype:Now, you can access
StordeDatawithmf.StordeDatawithinForm1.