T
TomTom
Hi,
I am creating a simple .NET UI app and have a question on the way parameters
are passed between classes. Here is the situation.
1. I created a UI (Form1 class). This UI has many UI controls.
2. I created a separate class called MyClass.
3. MyClass needs to know what values are assigned in the UI controls in
Form1. The values are used in MyClass.
I can change the access modifier of the UI controls in Form1 from private to
public, but I assume this is not a good practice. Should I pass all the
values in Form1 to MyClass when it's constructed? Or is there a better
method?
Thanks!
I am creating a simple .NET UI app and have a question on the way parameters
are passed between classes. Here is the situation.
1. I created a UI (Form1 class). This UI has many UI controls.
2. I created a separate class called MyClass.
3. MyClass needs to know what values are assigned in the UI controls in
Form1. The values are used in MyClass.
I can change the access modifier of the UI controls in Form1 from private to
public, but I assume this is not a good practice. Should I pass all the
values in Form1 to MyClass when it's constructed? Or is there a better
method?
Thanks!