0

Let's say I have form1 and form2. Form1 and Form2 are open. You click a button on Form2 and it adds 1 to a variable called myNumber on Form1.

Now the problem is I can't use the new keyword and create a new instance of Form1, because Form1 declares myNumber setting it to 0 on creation of the form. If myNumber gets set to 0 again then all the 1's that were added to that variable were added for nothing....

How do I pass a variable from Form2 to Form1 without creating a new instance of Form1?

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by noahssite
0

Resolved.

I made a few methods that added to myNumber. They had to be static though.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.