Subject: how do i pass value for GUI?
Posted By: redprawn_89 Post Date: 6/2/2008 9:35:44 PM
hi guys!
i'm new to visual studio 2005, C#.

I like to ask, how do i pass  values keyed-in by user to the next page for GUI application?

For Example:
The user is ask to key-in the amount of money he/she needs to borrow in form1.cs.
Then on form2.cs, i'm supposed to get the value keyed-in by user in form1.cs and multiply by the interest rate and let the user know how much interest he/she needs to pay on form2.cs.

Is this confusing?
Tks for the help! =)
Reply By: planoie Reply Date: 6/3/2008 8:17:59 AM
You could create some public properties on your forms to hand values back and forth.  Or pass the values in a method call of the form you are handing them to (this could be the form's constructor or an explicit method defined for this purpose.

Alternative, you could read about the Model-View-Controller design pattern which is intended to make this kind of behavior rather trivial.  Each form is a "View" to the "Model".  The "Model" is your data structure that contains all the parameters of the business operation.

-Peter
compiledthoughts.com
Reply By: redprawn_89 Reply Date: 6/3/2008 8:09:42 PM
quote:
Originally posted by planoie

You could create some public properties on your forms to hand values back and forth.  Or pass the values in a method call of the form you are handing them to (this could be the form's constructor or an explicit method defined for this purpose.

Alternative, you could read about the Model-View-Controller design pattern which is intended to make this kind of behavior rather trivial.  Each form is a "View" to the "Model".  The "Model" is your data structure that contains all the parameters of the business operation.

-Peter
compiledthoughts.com



Tks for the help! :D

Go to topic 71841

Return to index page 1