S
STom
I have a C# Winforms app that has 5 Winforms, lets say A through E.
A: Data entry. When data is entered here in any field, values are updated on
forms C, D, E.(Not B)
B: Data entry form. When data is entered here in any field, values are
updated on forms C, D, E (not A).
I am considering using delegates to fire events from forms A & B. In forms
C, D, E I will have functions with the same signature and even the same name
that just updates the data on those readonly screens.
Being new to delegates, I am a little confused on how to do this.
Do I:
1. Create a delegate in Form A and one in Form B.
2. Create a method in Form C, D, E where I can subscribe to the delegate
from forms A & B. This could be called on form load.
This is where my confusion starts (or possibly before)...when I subscribe to
the event in forms A and B, won't I need an instance of those form objects?
I don't think having form C, D, E have instances of Form A and B are the
appropriate way of doing it.
Am I way offbase with my thinking?
STom
A: Data entry. When data is entered here in any field, values are updated on
forms C, D, E.(Not B)
B: Data entry form. When data is entered here in any field, values are
updated on forms C, D, E (not A).
I am considering using delegates to fire events from forms A & B. In forms
C, D, E I will have functions with the same signature and even the same name
that just updates the data on those readonly screens.
Being new to delegates, I am a little confused on how to do this.
Do I:
1. Create a delegate in Form A and one in Form B.
2. Create a method in Form C, D, E where I can subscribe to the delegate
from forms A & B. This could be called on form load.
This is where my confusion starts (or possibly before)...when I subscribe to
the event in forms A and B, won't I need an instance of those form objects?
I don't think having form C, D, E have instances of Form A and B are the
appropriate way of doing it.
Am I way offbase with my thinking?
STom