Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将从一个代码开始:
private void button_newform_Click(object sender, EventArgs e) Form newF = new Form(); newF.show();
我有一个带有可以打开新表单的按钮的表单。
问题是,新表单有父级。
例如,如果我单击newform按钮,它将创建一个新表单。
newform
但是当我关闭这个表单时,新表单也会被关闭。
如何从现有表单创建一个独立的表单?
发生这种情况的原因是因为在项目->应用程序属性中,关闭模式设置为When startup Form closes. 将其更改为When Last form closes.
When startup Form closes
When Last form closes