I am relatively new to Object Oriented programming. Last year I wrote a standard visual studio C# Windows form app that had a lot of functionality. All code was in the same class (Form1). It included all of the user interface event code as well as additional code that started different threads and accessed multiple serial ports. This year I continued the application but added a lot more functionality to a second form that also had all its code in the same class (Form2) but also accessed the serial ports etc in the first class. This was fine. Here is the basic framework:
Now I find myself in the situation where due to a lack of a good background in OOP, I need to rearrange things and could really use some help.
What I would like to do now, is to modify the code so that there are two different Form1's (Form1A and Form1B). In other words when the application starts, based on a flag, a different form1 will be loaded. The dilemma is of course that I do not want to have two sets of code associated with each form each of which is pretty well identical but with different names for the objects. In other words, I would like to have two forms that only have the different user interface code handled by the form classes but have all of the rest of the code in a different class.
}
}
So what is the best way to go about this? Is my second concept sound? How can I minimize the effort of creating Form1B? There are about 125 user controls on each form (the app is used for real time radio control)
Thanks for any insight!
Tom