如何从MDIForm中停靠视图。 [英] How Can I dock out view from MDIForm.

查看:87
本文介绍了如何从MDIForm中停靠视图。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。



我现在用C ++和C#语言测试对接应用程序。



我已经制作了使用C#支持的DockPanel对接应用程序。如果你愿意,我可以把你的来源发给你。



现在,我已经用C ++在MDIForm中创建了项目,并尝试将MDIForm生成的视图停靠在它的文档中。但是该视图并未停留在它的文档中。



Visual Studio 2010上的源代码编辑器视图停靠良好,但我无法从MDIForm停靠视图。 />


我认为Visual Studio 2010也是MDIForm。我是对的吗?

如果是,我们可以将MDIForm生成的视图停靠在它的文档中。但是我不能这样做。



请帮助我。

解决方案

VisualStudio不是MDI表单,如果你想要像Visual Studio这样的东西试试 AvalonDock [ ^ ]。


除了解决方案1:



谁需要MDI?为什么要折磨自己并吓跑你的用户?

帮自己一个大忙:根本不要使用MDI。没有它,您可以更轻松地实现设计,质量更好。 MDI甚至被微软高度劝阻,事实上,微软将其从WPF中删除并且很难支持它。更重要的是,如果您使用MDI,您将吓跑所有用户。只是不要。请参阅:

http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages [ ^ ],

如何在WPF中创建MDI父窗口? [ ^ ]。



我可以解释做什么。请看我过去的答案:

如何在WPF中创建MDI父窗口? [解决方案2 ],

关于在WPF中使用MDI窗口的问题 [ ^ ],

麦当劳给出错误 [ ^ ],

如何设置子窗体最大化,最后一个子窗体最小化 [ ^ ]。



是的,我看到你想用C ++和MFC,但你也提到了C#。我从来没有听说过使用MFC的Visual Studio样式UI实现,MFC通常不用于创建高级UI,尽管原则上它是可能的。此外,您可以结合使用.NET和C ++解决方案,特别是如果您还使用C ++ / CLI。您可以开发纯C ++模块并通过 P / Invoke 在.NET应用程序中使用它们,或者您可以开发可直接在.NET中使用的C ++ / CLI项目,或者最后,您可以在C ++,C ++ / CLI甚至C的组合中开发混合模式项目,在C ++ / CLI类/结构中包装C / C ++代码,然后使用它们作为常规.NET引用此混合模式模块汇编。



请参阅:



http://en.wikipedia.org/wiki/P/Invoke [ ^ ],

http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp [ ^ ];



http://en.wikipedia.org/wiki/C%2B%2B/CLI [ ^ ],

http://www.gotw.ca/publications/C++CLIRationale.pdf [ ^ ],

http://www.ecma-international.org/publications/standards/Ecma-372 .htm [ ^ ],

http://msdn.microsoft.com/en-us /library/xey702bw.aspx [ ^ ]。



-SA

Hi.

I'm now test docking application with C++ and C# language.

I've already made docking application using DockPanel supported by C#. If you want, I can send you the source.

Now, I've created project within MDIForm in C++ and tried to dock view generated by MDIForm from it's document. But the view is not docked from it's document.

Source code editor view on Visual Studio 2010 is docked well, but I can't dock view from MDIForm.

I think Visual Studio 2010 is also MDIForm. Am I right?
If yes, we can dock view generated by MDIForm from it's document. But I can't do it.

Please, help me.

解决方案

VisualStudio is not an MDI form, if you want something like Visual Studio try AvalonDock[^].


In addition to Solution 1:

Who needs MDI, ever? Why torturing yourself and scaring off your users?
Do yourself a great favor: do not use MDI at all. You can do much easier to implement design without it, with much better quality. MDI is highly discouraged even by Microsoft, in fact, Microsoft dropped it out of WPF and will hardly support it. More importantly, you will scare off all your users if you use MDI. Just don't. Please see:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^],
How to Create MDI Parent Window in WPF?[^].

I can explain what to do instead. Please see my past answers:
How to Create MDI Parent Window in WPF? [Solution 2],
Question on using MDI windows in WPF[^],
MDIContainer giving error[^],
How to set child forms maximized, last childform minimized[^].

Yes, I saw that you wanted to use C++ and MFC, but you mentioned C# as well. I never heard of Visual Studio style UI implementation with MFC, which is typically not used for creation of advanced UI, even though it is possible, in principle. And also, you can combine .NET and C++ solution, especially if you also use C++/CLI. You can develop pure C++ modules and use them in .NET application via P/Invoke, or you can develop C++/CLI project(s) which can be uses in .NET directly, or, finally, you can develop mixed-mode project(s) whiten in the combination of C++, C++/CLI and even C, wrap C/C++ code in C++/CLI classes/structures and then use them referencing this mixed-mode module as a regular .NET assembly.

Please see:

http://en.wikipedia.org/wiki/P/Invoke[^],
http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp[^];

http://en.wikipedia.org/wiki/C%2B%2B/CLI[^],
http://www.gotw.ca/publications/C++CLIRationale.pdf[^],
http://www.ecma-international.org/publications/standards/Ecma-372.htm[^],
http://msdn.microsoft.com/en-us/library/xey702bw.aspx[^].

—SA


这篇关于如何从MDIForm中停靠视图。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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