Wednesday, January 26, 2011

WPF Hosting Winform

When hosting a WinForm in a WPF application, the WinForm will not render correctly.

This is because in the Program.cs file:

        System.Windows.Forms.Application.EnableVisualStyles();

is called.

You must do this manually.

{
   System.Windows.Forms.Application.EnableVisualStyles();

   WindowsFormsHost wfh ...

   ...
}

No comments:

Post a Comment