学习 .NET:
我有一个带有拆分容器的表单,我想将用户控件加载到 panel2 中,但是
splitContainer1.Panel2.add(..)
不起作用。
编辑,现在工作:
private void button1_Click(object sender, EventArgs e)
{
UserControl1 myUserCont = new UserControl1();
splitContainer1.Panel2.Controls.Add(myUserCont);
}
- 如何将用户控件加载到其中?
- 加载到面板时,用户控件中的数据绑定(bind)是否有效?
- 在 panel1 中,将有一个用于(数据绑定(bind))对象类型导航的 TreeView 。我走的路对吗?
问候,
/T
最佳答案
使用这段代码:
splitContainer1.Panel2.Controls.Add(...)
关于c# - 如何将用户控件加载到 splitcontainer.panel2 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8149265/