您可以用模拟所需的手工面板替换tabcontrol:
class MultiPagePanel : Panel{ private int _currentPageIndex; public int CurrentPageIndex { get { return _currentPageIndex; } set { if (value >= 0 && value < Controls.Count) { Controls[value].BringToFront(); _currentPageIndex = value; } } } public void AddPage(Control page) { Controls.Add(page); page.Dock = DockStyle.Fill; }}
然后添加页面并设置当前可见页面:
MultiPagePanel p;// MyTabPage is a Control derived class that represents one page on your form.MyTabPage page = new MyTabPage(); p.AddPage(page);p.CurrentPageIndex = 0;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)