尝试在WPF中模拟VB6无模式窗口行为 [英] Trying to emulate VB6 modeless window behavior in WPF

查看:104
本文介绍了尝试在WPF中模拟VB6无模式窗口行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写WPF应用程序以替换旧的VB6应用程序.它控制着工业制造过程.在旧的VB6应用中,零件"从菜单中选择,并且每个部分都产生一个"Part Window".可以在MDI表单中自由拖动 没有超越.零件窗口位于MDI表单的顶部,但它们不会模糊主菜单.

I'm writing a WPF application to replace an old VB6 app. It controls an industrial manufacturing process. In the old VB6 app "parts" are selected from a menu and each part spawns a "Part Window" which can be dragged around freely within an MDI form, but not beyond it. The parts windows stay on top of the MDI form but they do not obscure the main menu.

您可以一次在屏幕上显示多个部分窗口.零件窗口包含一个列表框和其他各种控件,并实现为无模式对话框.

You can have several part windows on the screen at once. The part window hosts a listbox and various other controls and is implemented as a modeless dialog.

我想在WPF中模仿这种行为,但我想不出一种方法来做到这一点.最初,我试图通过实际生成一个Window来做到这一点,但是如果不将它移到主菜单上,就无法将其保留在所有者窗口的顶部.看: 约束子窗口

I want to emulate this behavior in WPF but I can't think of a way to do it. At first I tried to do it by literally spawning a Window but I couldn't keep it on top of the owner window without it also going over the main menu. See: Constraining child windows

因此,还有其他方法可以做到这一点,例如从面板派生的类吗?我正在尝试将其保留在.Net框架和托管代码中.

So is there some other way to do this, say with a panel-derived class? I'm trying to do this staying within the .Net framework and managed code.

预先感谢.

推荐答案

您可以尝试以下方法:

you can try this:

http://wpfmdi.codeplex.com/

http://wpfmdi.codeplex.com/

我认为没有办法在wpf中创建mdi项目

i think there is no build in way to create a mdi project in wpf


这篇关于尝试在WPF中模拟VB6无模式窗口行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆