muliple class problem
-
I have a class called Graph.cs and in this class I set the values of some data from another class called Data.cs. I then try and read this data from another class called DrawGraph.cs, but I can't seem to read the data I set before this is because it is creatinga new instance of the Graph.cs class is there anyway around this. Thanks :)
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
-
I have a class called Graph.cs and in this class I set the values of some data from another class called Data.cs. I then try and read this data from another class called DrawGraph.cs, but I can't seem to read the data I set before this is because it is creatinga new instance of the Graph.cs class is there anyway around this. Thanks :)
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
fix your code, it's obvioulsy broken. You're creating a new class instance, they don't create themselves.
Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.
-
fix your code, it's obvioulsy broken. You're creating a new class instance, they don't create themselves.
Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.
-
fix your code, it's obvioulsy broken. You're creating a new class instance, they don't create themselves.
Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.
Christian Graus wrote:
You're creating a new class instance, they don't create themselves.
:laugh: That's why this C# fad will never last.
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
I have a class called Graph.cs and in this class I set the values of some data from another class called Data.cs. I then try and read this data from another class called DrawGraph.cs, but I can't seem to read the data I set before this is because it is creatinga new instance of the Graph.cs class is there anyway around this. Thanks :)
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
Hi, I had the same question here with no positive answers and did a lot of reading finding the answer in Delegates and Event handling - do a search in the articles in Delegates and Event handling. It ends up a long and tedious process of three pages of coding to fix. I got fed up and just posted the variables as public static and then everything can see it allways. Very crude and non conforming to OOP, but quick !! cheers Ian