J
John Dann
VB.Net 2005:
I have a class that performs some functions and then needs to update
some labels on the main form (from which it is called) with several
pieces of information, some text, some datetime etc, according to the
results of the calculations.
I can see at least a couple of ways of doing this:
1. Define a structure that contains all the items of information that
I need to pass back and assign a variable with this structure as the
return value to the calling routine in the main form. (Assuming I can
do this.)
2. Raise a custom event in the client class that passes the required
data items as separate arguments. Monitor this event in the main form
and update the form labels whenever the event is raised.
Any views on which of these options might be preferred (or any other
alternatives?
JGD
I have a class that performs some functions and then needs to update
some labels on the main form (from which it is called) with several
pieces of information, some text, some datetime etc, according to the
results of the calculations.
I can see at least a couple of ways of doing this:
1. Define a structure that contains all the items of information that
I need to pass back and assign a variable with this structure as the
return value to the calling routine in the main form. (Assuming I can
do this.)
2. Raise a custom event in the client class that passes the required
data items as separate arguments. Monitor this event in the main form
and update the form labels whenever the event is raised.
Any views on which of these options might be preferred (or any other
alternatives?
JGD