I have a user control named General_Inputs
and i am attempting to access three different objects called OBJ_CurrentEngine
, OBJ_CurrentGearBox
and OBJ_CurrentChassis
which are declared and initialized in my Program.cs
after the user control is created and therefore i cannot pass these in as parameters.
I had a similar issue however it was with a normal varaible and I managed to find a fix for this by making the variable global and accessing it in the user control like so:
protected bool FUNCT_GrabValuesHaveBeenLoaded //Gets the has been loaded boolean from main project
{
get { return (Engine_Simulator.Program.ValuesHaveBeenLoaded); }
}
I also tried to make the objects public in order to access them the same way as above however the program then forces me to make them static which breaks the rest of my code:
[I have tried my best to make my question as good as possible please dont downvote me just let me know if something is wrong and I will change it.]