30.2. Mixing Windows and Forms

The cleanest way to integrate WPF and Windows Forms content is to place each in a separate window. That way your application consists of well-encapsulated window classes, each of which deals with just a single technology. Any interoperability details are handled in the glue code—the logic that creates and shows your windows.

30.2.1. Adding Forms to a WPF Application

The easiest approach to mixing windows and forms is to add one or more forms (from the Windows Forms toolkit) to an otherwise ordinary WPF application. Visual Studio makes this easy—just right-click the project name in the Solution Explorer, and choose Add → New Item. Then, select the Windows Forms category on the left side, and choose the Windows ...

Get Pro WPF in C# 2010: Windows Presentation Foundation in .NET 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.