Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 13th, 2007, 12:08 AM
Authorized User
Join Date: Sep 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing Parameters Between Two Forms

Hello, I have one main form with a text box that needs to be filled by a parameter from a second form (which opens on a button click in form1). Right now I have something that looks like this:

//in form1
private void button1_Click(Object sender, EventArgs e) {
   form2 f2 = new form2();
   //looks like I need some kind of system pause here...
   //I tried a system pause and a Console.ReadLine, to no avail
   textBox1.Text = f2.param.ToString();

The problem is that f2.param fills the textBox right away, before it can be retrieved from the user on form2. If its not obvious, I'm a little new to C#.
Thanks for the help.
Reply With Quote
  #2 (permalink)  
Old January 13th, 2007, 02:50 AM
Friend of Wrox
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts

For one thing, it sounds like you might want to be using the ShowDialog method of fr:


Woody Z
Reply With Quote
  #3 (permalink)  
Old January 13th, 2007, 10:44 PM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts

There is another similar topic that may be of interest.

They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
passing parameters fizzerchris Access VBA 5 August 31st, 2007 12:16 PM
Passing parameters tal Ajax 5 May 26th, 2007 08:07 AM
Passing parameters ceema Crystal Reports 0 February 15th, 2006 04:03 AM
Access Forms Open Method of Passing Parameters androman Access VBA 8 September 22nd, 2004 09:04 AM
passing parameters spraveens Javascript How-To 1 October 8th, 2003 03:14 AM

All times are GMT -4. The time now is 09:42 PM.

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