gpt4 book ai didi

c# - 指定为此表单的 MdiParent 的表单不是 MdiContainer

转载 作者:太空狗 更新时间:2023-10-29 19:50:05 25 4
gpt4 key购买 nike

我当时正在开发一个库存软件,突然发现我需要一些主窗体,我应该通过它打开所有其他窗体,所以我创建了一个名为 frmMainPanel 的窗体,并使用菜单条将它链接到另一个窗体,我成功了在链接它们但它们在主窗体之外打开时,我使用以下代码链接它们

链接 frmSaleInvoice 表单使用:

frmSaleInvoice childForm = new frmSaleInvoice();
cs.show()

现在我意识到我应该让它们成为主窗体的子级,所以我尝试使用以下代码:

frmSaleInvoice childForm = new frmSaleInvoice();

childForm.MdiParent = this;
childForm.Show();

但它说 **"Form that was specified to be the MdiParent for this form is not an MdiContainer."**

谁能帮我解决我弄错的问题,我怎么能把一个名为 frmSaleInvoice 的表格制作成另一个名为 frmMainPanel 的表格的 child

最佳答案

Mdi 父级必须有它的 IsMdiContainer属性设置为 True。您可以在设计时在 frmMainPanel 表单中设置此属性。

关于c# - 指定为此表单的 MdiParent 的表单不是 MdiContainer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22619261/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com