简体   繁体   English

如何在 mfc 应用程序中添加 windows 窗体?

[英]how to add windows form in mfc application?

我想知道如何将Windows 窗体添加到 MFC 应用程序(基于对话框)并将其与 MFC 对话框连接,以便我可以使用 Visual C++ 进行编程?

The MFC class CWinFormsControl "provides the basic functionality for hosting of a Windows Forms control in a MFC application". MFC 类CWinFormsControl “提供了在 MFC 应用程序中承载 Windows 窗体控件的基本功能”。 One can encapsulate more Winform standard controls in a .NET custom control (derived from the System.Windows.Forms.Control class) and then use it in the MFC app through the CWinFormsControl.可以将更多的 Winform 标准控件封装在一个.NET 自定义控件(派生自 System.Windows.Forms.Control 类)中,然后通过 CWinFormsControl 在 MFC 应用程序中使用它。

The MFC application must use the /clr flag (Common Language Runtime Support). MFC 应用程序必须使用 /clr 标志(公共语言运行时支持)。

http://www.functionx.com/visualc/Lesson04.htm http://www.functionx.com/visualc/Lesson04.htm

I think this is what you are looking for, hope this helps.我想这就是你要找的,希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM