winform如何加载用户控件,以用户控件来启动和显示
展开全部
private void ShowUserControls(string UserControlName, DevExpress.XtraEditors.PanelControl PanelName)
{
PanelName.Controls.Clear();
Type t = System.Reflection.Assembly.GetExecutingAssembly().GetType(UserControlName);
UserControl uc = (UserControl)Activator.CreateInstance(t);
uc.Dock = DockStyle.Fill;
uc.Parent = PanelName;
}
{
PanelName.Controls.Clear();
Type t = System.Reflection.Assembly.GetExecutingAssembly().GetType(UserControlName);
UserControl uc = (UserControl)Activator.CreateInstance(t);
uc.Dock = DockStyle.Fill;
uc.Parent = PanelName;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询