Subject: Passing Parameters Between Two Forms
Posted By: sjf905 Post Date: 1/12/2007 11:08:14 PM
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();
   f2.Show();
   //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 By: woodyz Reply Date: 1/13/2007 1:50:13 AM
For one thing, it sounds like you might want to be using the ShowDialog method of fr:

f2.ShowDialog();



Woody Z
http://www.learntoprogramnow.com
Reply By: rodmcleay Reply Date: 1/13/2007 9:44:28 PM
There is another similar topic that may be of interest.
http://p2p.wrox.com/topic.asp?TOPIC_ID=54689


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

Go to topic 54815

Return to index page 64
Return to index page 63
Return to index page 62
Return to index page 61
Return to index page 60
Return to index page 59
Return to index page 58
Return to index page 57
Return to index page 56
Return to index page 55