WinForm Communications in .NET

  • Thread starter Thread starter dev
  • Start date Start date
D

dev

Can anyone tell me the best, or widely accepted practice for Windows
Forms to talk to each other with Visual Studio 2005 and c#. I was using
Events/Delegates, but without the need for multicasting it seems a
little much. Passing WinForm object references around feels sloppy.
I've been using interfaces, e.g. having a common interface for the
forms needing to communicate, and this works well for me, but I'd like
a standard to follow. Thanks!
 
Can anyone tell me the best, or widely accepted practice for Windows
Forms to talk to each other with Visual Studio 2005 and c#. I was using
Events/Delegates, but without the need for multicasting it seems a
little much. Passing WinForm object references around feels sloppy.
I've been using interfaces, e.g. having a common interface for the
forms needing to communicate, and this works well for me, but I'd like
a standard to follow. Thanks!

I have been using SC-BAT pattern for a while, in this pattern, event
broker is used heavily to communicate between forms.
 
Hi,

Can anyone tell me the best, or widely accepted practice for Windows
Forms to talk to each other with Visual Studio 2005 and c#. I was using
Events/Delegates, but without the need for multicasting it seems a
little much. Passing WinForm object references around feels sloppy.
I've been using interfaces, e.g. having a common interface for the
forms needing to communicate, and this works well for me, but I'd like
a standard to follow. Thanks!

I also have used the three methods (even if the two latter are similar). I
use either one depending of the need of the app. If all you need in your app
is that one particular form communicate with just another then passing a
reference is OK, If I need that a particular form communicate with more than
one form then I implement an interface.


Again, based on your project needs you select the best, easier way to
implement form intercommunication.
 
Back
Top