开发者

accessing variables from another class

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜