我曾经阅读过有关如何创建新表单并将其置于所有其他窗口之上的教程,以便您只能单击它 - 例如在Internet Explorer中,例如当您单击浏览文件时,您无法单击主窗口,直到您使用浏览窗口完成.
还有什么是从表单中获取值的最佳方法,为了在我的第二个表单上进行扩展,我有一个列表框,当用户点击其中一个值时,第一个表单(mainform)应该得到事件 - 这可能吗?
这听起来像你想要的:
using (MyCustomForm form = new MyCustomForm(...))
{
if (form.ShowDialog() == DialogResult.OK) {
// Now use the values in form
// (e.g. through properties of the form)
}
}
Run Code Online (Sandbox Code Playgroud)