J
jake
Hi everyone,
I have a form and on it I have place two different object derived from
panel. When someone clicks on the first object I want to do a
calculation and then call a method in the second object which does
another calculation and then displays the result.
So when the first object is clicked I need to call a method in the
second object. To do this I am making the second class a property of
the first class and then passing the second object into the
constructor. By my understanding this will not make a second copy of
the object but holds a reference (<- not sure what the correct term
is) to the original object.
public class FirstObject : System.Windows.Forms.Panel
{
Panel thePanel;
SecondObject theSecondObject;
Here are my questions firstly is the term reference in the last line
correct and secondly is this the best solution to the problem.
thanks
jake
I have a form and on it I have place two different object derived from
panel. When someone clicks on the first object I want to do a
calculation and then call a method in the second object which does
another calculation and then displays the result.
So when the first object is clicked I need to call a method in the
second object. To do this I am making the second class a property of
the first class and then passing the second object into the
constructor. By my understanding this will not make a second copy of
the object but holds a reference (<- not sure what the correct term
is) to the original object.
public class FirstObject : System.Windows.Forms.Panel
{
Panel thePanel;
SecondObject theSecondObject;
Here are my questions firstly is the term reference in the last line
correct and secondly is this the best solution to the problem.
thanks
jake