Share via


CWinFormsDialog Class

A wrapper for an MFC dialog class that hosts a Windows Forms user control.

template <typename TManagedControl>
class CWinFormsDialog : 
   public CDialog

Parameters

  • TManagedControl
    The .NET Framework user control to be displayed in the MFC application.

Members

Public Constructors

Name

Description

CWinFormsDialog::CWinFormsDialog

Constructs a CWinFormsDialog object.

Public Methods

Name

Description

CWinFormsDialog::GetControl

Retrieves a reference to the Windows Forms user control.

CWinFormsDialog::GetControlHandle

Retrieves a window handle to the Windows Forms user control.

CWinFormsDialog::OnInitDialog

Initializes the MFC dialog box by creating and hosting a Windows Forms user control on it.

Public Operators

Name

CWinFormsDialog::operator ->

Replaces CWinFormsDialog::GetControl in expressions.

CWinFormsDialog::operator TManagedControl^

Casts a type as a reference to a Windows Forms user control.

Remarks

CWinFormsDialog is a wrapper for an MFC dialog class (CDialog) that hosts a Windows Forms (UserControl) user control. This allows the display of .NET Framework controls on a modal or modeless MFC dialog box.

For more information on using Windows Forms, see Using a Windows Form User Control in MFC and Hosting a Windows Form User Control as an MFC Dialog Box.

Requirements

Header: afxwinforms.h

See Also

Reference

CWnd Class

CWinFormsView Class

CDialog Class

UserControl