Hi Dave,
As for the question you mentioned, I think Deepak's suggestion on apply a
MVC pattern is quite reasonable. For such scenario, we need to separate the
data with the displaying UI. Just use the more specific question you
mentioned:
Form1 has txt1 which display the total count
Form2 has txt2 which accept the user's new input
Then, Form1 and Form2 and all the controls on them are the UI, and the
actual data should be maintained in the application in separate place. We
can use a custom class (has a member variable ), for example named
"CountManager" to hold the total count. Then, when the user input new value
in the Form2's txt2 and click OK to submit it. We hide Form2 and update the
value in the custom class, just like:
CountManager.Total + = txt2.newValue;
Form2.Hide
Then, make Form1 visible, that'll fire the Form1's Activate event, and in
this event , we need to update the Form1's UI from the DAta
Store(CountManager.Total).
So this is a general progress of interaction between two forms. We can
abstract the progress as :
User change the UI(input) -----> update the data in data store(in memory
or other storage) ----------> fire event to Refresh UI ------> UI
retrieve updated data from data store and update it self.
Here is the reference on the UI process Application block in MSDN:
#User Interface Process Application Block for .NET
http://msdn.microsoft.com/library/de...us/dnbda/html/
uip.asp
Hope also helps. thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)