有个问题搞的我很别扭
于娜 2006-12-01 08:14:54 有个问题搞的我很别扭。在弹出的对话窗体中有一个ListBox控件,当回到主窗体时候,我想从主窗体中访问对话窗体中的ListBox,怎么做?如果把ListBox设置成public 或者 internal ,微软不推荐这么做。怎么办?
我是这样解决,我另外写了一个公有属性,通过它来访问私有的ListBox,不知道合理不合理??
private ListBox UserList
public ListBox UList
{
get
{
return this.UserList;
}
set
{
this.UserList = value;
}
}