i made a program that opens another form and in that form there are two buttons, when one of the buttons are clicked a varible is beening set and the form colses,
now i want to use thoes varible in my main form
Asked
Active
Viewed 56 times
0

ron cohen
- 295
- 1
- 3
- 9
-
Windows or web application? – Colin Jul 20 '15 at 16:44
-
While your buttons are likely to be private, why don't you just make those variables public? Then you can access them anywhere. – LaneL Jul 20 '15 at 16:49
-
@LaneL, no, no, no! Never encourage public variables for sharing data, for that can only lead to tears (specifically around unreliable, untestable, code) – David Arno Jul 20 '15 at 20:24
-
Do enlighten me on how to transfer data from one form to another without there being a public interface of some sort. Perhaps set them to internal assuming all forms are in the same assembly? – LaneL Jul 20 '15 at 21:49