13.11. Use a Windows Presentation Foundation Control from a Windows Form

Problem

You need to use a Windows Presentation Foundation (WPF) control or controls from a Windows Forms application rather than from a WPF application.

Solution

Use the ElementHost control to host the desired WPF control.

How It Works

Windows Presentation Foundation (WPF), discussed in some detail in Chapter 10, is a new application framework, introduced in .NET Framework 3.0. WPF includes enhanced controls and functionality for building Windows applications with a more advanced user interface. They are constructed in a similar manner as ASP.NET applications in that the interface is designed using a markup language (XAML, in this case) and events are handled with managed ...

Get Visual Basic 2008 Recipes: A Problem-Solution Approach 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.