Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CWinFormsControl Class
Collapse the table of content
Expand the table of content

CWinFormsControl Class

Provides the basic functionality for hosting of a Windows Forms control.

template<class TManagedControl>
class CWinFormsControl : public CWnd

TManagedControl

A .NET Framework Windows Forms control to be displayed in the MFC application.

Name

Description

CWinFormsControl::CWinFormsControl

Constructs an MFC Windows Forms control wrapper object.

Name

Description

CWinFormsControl::CreateManagedControl

Creates a Windows Forms control in an MFC container.

CWinFormsControl::GetControl

Retrieves a pointer to the Windows Forms control.

CWinFormsControl::GetControlHandle

Retrieves a handle to the Windows Forms control.

Name

Description

CWinFormsControl::operator ->

Replaces CWinFormsControl::GetControl in expressions.

CWinFormsControl::operator TManagedControl^

Casts a type as a pointer to a Windows Forms control.

The CWinFormsControl class provides the basic functionality for hosting of a Windows Forms control.

For more information on using Windows Forms, see Using a Windows Form User Control in MFC.

Your MFC code should not cache Window handles (usually stored in m_hWnd). Some Windows Forms control properties require that the underlying Win32 Window be destroyed and recreated using DestroyWindow and CreateWindow. The MFC Windows Forms implementation handles the Destroy and Create events of the controls to update the m_hWnd member.

Note Note

MFC Windows Forms integration works only in projects which link dynamically with MFC (in which AFXDLL is defined).

Header: afxwinforms.h

Show:
© 2015 Microsoft