WinForms - 显示对话框并仍然使用调用表单

发布于 2024-09-30 10:57:01 字数 195 浏览 0 评论 0原文

我有一个要求,用户希望能够单击按钮来显示包含一些信息的对话框。他们希望能够将对话框移出表单,并将焦点放回到调用表单上,并在对话框仍然打开的情况下对调用表单进行更改。

它基本上是主窗体上的地图,对话框是地图图例。

这可能吗?我将如何完成这个任务?似乎我需要对面板执行一些操作,就像 Visual Studio 如何使用其可停靠面板执行此操作一样。

I have a requirement where the user wants to be able to click a button to show a dialog with some information. They want the ability to move the dialog off of the form and put focus back on the calling form and make changes to the calling form with the dialog still open.

It is basically a map on the main form and the dialog is a map legend.

Is this possible? How would I accomplish this task? It seems like I would need to do something with a panel like how Visual Studio does this with their dockable panels.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梅倚清风 2024-10-07 10:57:01

调用 Show 方法而不是 显示对话框

此方法是非阻塞调用(与 ShowDialog 不同,它将立即返回,而不是在新表单关闭后返回),并且不会以模态方式显示表单。
您可能希望将父表单作为参数传递,以便它将显示为子表单。

Call the Show method instead of ShowDialog.

This method is a non-blocking call (unlike ShowDialog, it will return immediately, not after the new form closes) and will not show the form modally.
You'll probably want to pass the parent form as the parameter so that it will show as a child form.

说不完的你爱 2024-10-07 10:57:01

您可以以非模式方式显示对话框。

像这样:

formLegend.Show();

You can show the dialog in non-modal way.

Like this:

formLegend.Show();
枯叶蝶 2024-10-07 10:57:01

不用调用 legendForm.ShowDialog(),只需使用 legendForm.Show()。它将显示图例形式,而不限制地图的使用。

Insead of calling legendForm.ShowDialog(), just use legendForm.Show(). It will display the legend form without restricting the map's usage.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文