spearchucker
Programmer
I have a form, MainForm that I am using as the main GUI. I also have another form called StatsForm that I want to be able to control using MainForm's gui. The main thing I want to control is StatsForm's Hide() and Show() methods. I also have another file which holds some other various
classes and variables that are the basic workings of the programs, I call this class LORD. Now to my problem...In order for MainForm to be able to affect StatsForm I
made a reference to it in my LORD class' code. I wrote this:
StatsForm statsForm;
MainForm mainForm;
and in the constructor, I wrote this:
statsForm = new StatsForm;
mainForm = new MainForm;
So I am trying to use LORD.cs as the middle of the spiderweb so it has access to everything and can act as a middleman in lots of operations. First off, is my thinking correct, is there an easier way to do what I am
doing, I am new at this - should I organize my code and classes differently? All in one file perhaps, please give input. Secondly, my approach doesnt even work. Because I was using my LORD class as the center point, I had to declare it in all my forms like this:
LORD lord = new LORD;
This gave me many errors about nonstatic fields and missing namespaces! Am I missing something here, how do you guys make your programs containing multiple windows talk to eachother.
Please, perhaps use this as an opportunity to give a new kid with lots of motivation a short tutorial about design?
I would really appreciate it, I have so much drive, yet confusion of how to work it!
Brian Harris
classes and variables that are the basic workings of the programs, I call this class LORD. Now to my problem...In order for MainForm to be able to affect StatsForm I
made a reference to it in my LORD class' code. I wrote this:
StatsForm statsForm;
MainForm mainForm;
and in the constructor, I wrote this:
statsForm = new StatsForm;
mainForm = new MainForm;
So I am trying to use LORD.cs as the middle of the spiderweb so it has access to everything and can act as a middleman in lots of operations. First off, is my thinking correct, is there an easier way to do what I am
doing, I am new at this - should I organize my code and classes differently? All in one file perhaps, please give input. Secondly, my approach doesnt even work. Because I was using my LORD class as the center point, I had to declare it in all my forms like this:
LORD lord = new LORD;
This gave me many errors about nonstatic fields and missing namespaces! Am I missing something here, how do you guys make your programs containing multiple windows talk to eachother.
Please, perhaps use this as an opportunity to give a new kid with lots of motivation a short tutorial about design?
I would really appreciate it, I have so much drive, yet confusion of how to work it!
Brian Harris