Embedding ActiveX controls in WPF applications
WPF also supports ActiveX, which you can easily embed in a WPF application. This is not feature specific to WPF, but it works because of interoperability with Windows Forms. The WinForm acts as an intermediate layer between the two.
There are several ActiveX controls present, which can be easily embedded in any WPF application. In this recipe, we will learn how to embed an ActiveX control by following some simple steps. We will demonstrate it using the Microsoft Terminal Services Control that ships with Windows.
Getting ready
Make sure Visual Studio is up and running. Create a new WPF project and name it as CH11.ActiveXDemo
.
How to do it...
Follow these steps to generate the required libraries for the Microsoft Terminal Services ActiveX control and embed it inside our WPF application:
- The first step is to generate the required libraries of our ActiveX control. This is required to get a managed and Windows Forms compatible definition of the relevant...