Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 2nd, 2008, 09:35 PM
Registered User
 
Join Date: Jun 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default how do i pass value for GUI?

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! =)
 
Old June 3rd, 2008, 08:17 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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
 
Old June 3rd, 2008, 08:09 PM
Registered User
 
Join Date: Jun 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Gui program P.Wheat Windows Server 0 February 23rd, 2008 11:06 PM
C# GUI Seperation lesliev C# 0 September 17th, 2006 03:03 PM
GUI question hlchuah77 C++ Programming 2 October 4th, 2004 07:10 PM
help in GUI khfarooq Java GUI 5 August 22nd, 2004 05:00 AM
very basic gui wiggins Java GUI 1 August 27th, 2003 12:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.