ozzy

ozzy

  • NA
  • 8
  • 0

Passing data from one form to another

Jul 18 2007 5:23 AM
Hi, I have a windows form and when I press a button I want the second form to appear and show me a value which is already in the first one. For example, in Form 1 I have public int number = 1; and when I press the button in Form 1, the other form will appear and show me 1. The only problem is that I don't know how to access the values of the first form. On Form 2, I tried to create an instance of Form1 but didn't work, because I shouldn't instantiate another object but instead I have to use the one that I created. Any idea how to do that? Thanks for your help.

Answers (1)