作者:liyanyl_499 | 来源:互联网 | 2023-10-14 11:36
设置属性如图,xtraTabControl中的子窗体标题处会显示关闭按钮。关闭事件如下:privatevoidxtraTabControl1_CloseButtonClick(ob
设置属性如图,xtraTabControl中的子窗体标题处会显示关闭按钮。
关闭事件如下:
private void xtraTabControl1_CloseButtonClick(object sender, EventArgs e)
{
XtraTabControl tabCOntrol= sender as XtraTabControl;
ClosePageButtonEventArgs arg = e as ClosePageButtonEventArgs;
var page = arg.Page as XtraTabPage;
if (page.HasChildren)
{
tabControl.TabPages.Remove(page);
page.Controls.Clear();
page.Dispose();
}
}