物料主界面使用DEV 的Rinnbon control

使用MDI,main_form为父窗口
//
// Main_Form
//
this.IsMdiContainer = true;
this.Name = "Main_Form";
this.ShowIcon = false;
this.Text = "SY_BOM/采购与仓储";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.Main_Form_Load);
this.ResumeLayout(false);
设定只能打开一个子窗口,
在打开子窗口时判断有否有活动子窗口并试图关闭,
private void buyList_barButtonItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
//关闭所有子窗口
foreach (Form child_form in this .MdiChildren )
{
child_form.Close();
}
//没有子窗口后,建新窗口
//同时只能有一个子窗口
if (this.ActiveMdiChild ==null )
{
BuyList_Form My_BuyList_Form = new BuyList_Form();
My_BuyList_Form.MdiParent = this;
My_BuyList_Form.Show();
}
}
本文介绍了一种使用MDI窗体进行子窗口管理的方法。通过设定Main_Form为主窗口,并限制同一时间只允许存在一个子窗口,确保了界面的简洁性和操作的连贯性。当点击特定按钮时,会关闭所有已打开的子窗口,并创建新的BuyList_Form实例。
2613

被折叠的 条评论
为什么被折叠?



