i have 2 classes(a form class and a user-control class) and in the form one i have开发者_开发问答 a list. I would like to access that list from the user control class. How can i do it ? i could pass a reference from the form class to the user control class , but i am curious if there is another way ?
Regards, Alexandru Badescu
Passing it as a reference is your best option - this is how you should do it.
It keeps coupling between the user control and the form to a minimum and allows the user control to be used elsewhere.
精彩评论