C#winform在tabcontrol里动态加载的子窗体,怎么才能随着tabcontrol大小的改变面改变
TabPagetab=newTabPage();studentMngfrm=newstudentMng();frm.uid=this.uid;frm.TopLevel=f...
TabPage tab = new TabPage();
studentMng frm = new studentMng();
frm.uid = this.uid;
frm.TopLevel = false;
tab.Controls.Add(frm);
tab.Name = "studentMng";
tab.Text = "学生管理";
tab.BackColor = System.Drawing.Color.White;
tab.AutoScroll = true;
foreach (TabPage page in main.Main.tabControl1.TabPages)
{
if (page.Text == "学生管理")
{
main.Main.tabControl1.SelectedTab = page;
break;
}
}
if (main.Main.tabControl1.SelectedTab.Text != "学生管理")
{
main.Main.tabControl1.TabPages.Add(tab);
frm.Show();
main.Main.tabControl1.SelectedTab = tab;
} 展开
studentMng frm = new studentMng();
frm.uid = this.uid;
frm.TopLevel = false;
tab.Controls.Add(frm);
tab.Name = "studentMng";
tab.Text = "学生管理";
tab.BackColor = System.Drawing.Color.White;
tab.AutoScroll = true;
foreach (TabPage page in main.Main.tabControl1.TabPages)
{
if (page.Text == "学生管理")
{
main.Main.tabControl1.SelectedTab = page;
break;
}
}
if (main.Main.tabControl1.SelectedTab.Text != "学生管理")
{
main.Main.tabControl1.TabPages.Add(tab);
frm.Show();
main.Main.tabControl1.SelectedTab = tab;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询