I have a winforms applications which should be able to communicate with a custom device. I have a main window which has a button "Disconnect". I have a user control which handles the logging, and a class (SerialCom) which handles all communciation.

When I load the user control I also setup the com port in the SerialCom class. This class receives data, and sends it to the user control via INotifyPropertyChanged, see this question for more detail here.

I want to acces the class SerialCom from the MainForm, without having to new the SerialCom class. but the SerialCom class is first created on the user control. (so, if I new the SerialCom class from the MainForm, the serial port will not be open, so I cannot close it.)

Any tips on how to acces class A from class B and C without having to new class A again? I was thinking about passing the event between the forms, is this the best option?

there are many options here: you could pass a reference to the object from A to B, you could have a "program" class which is accessible by any form in your application. You could have a delegate for an event. You could use an observer/observable construction. The world is at your feet. :)
–
BazzzNov 20 '12 at 8:44

Perhaps you are looking for a singleton. Basically, a single is an object that only allows a single instance to be initialised, and provides a mechanism (through static methods/properties) to access this instance from anywhere.