transfer a value from one form to another

  • Thread starter Thread starter JD
  • Start date Start date
J

JD

I have a form with a textbox that will hold a mean value. When the textbox
gets focus, another form pops up, values are entered, and the mean value is
calculated. The mean value is stored in a Public variable. The two forms
are in different classes. How do I transfer this value to the original
textbox?
 
The easiest way is to create a custom control that returns the calculated
value to the calling form.
 
FormMeanCal f = new FormMeanCal();
f.ShowDialog();
oriTextBox.text = f.sMeanValue;

public string sMeanValue; // FormMeanCal
where you put the calculated value

i hope this help
 
I will give it a try.
Thank you

MP said:
FormMeanCal f = new FormMeanCal();
f.ShowDialog();
oriTextBox.text = f.sMeanValue;

public string sMeanValue; // FormMeanCal
where you put the calculated value

i hope this help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top