Skip to main content Skip to footer

How to use a licensed WinForms control in a WPF application

WPF supports the use of WinForms without too much trouble. But when it comes to using licensed controls, whether they are from ComponentOne or another vendor, you may run into licensing problems with WPF. This is because the licensing mechanism used by the control is specific to WinForms only. The trick is to add a Windows Form somewhere in your WPF project, and drop an instance of the WinForms control onto it. This way, Visual Studio will pick up on the licensing code and properly generate the licenses.licx file. This is necessary so you get no evaluation messages in your published application. The extra Windows Form you create can sit completely out of view to end-users.

For example, in your WPF application select Project - Add New Item. Select Windows Form from the list. Then you will see all WinForms controls in your toolbox. Drop an instance of the control on your Windows Form. This adds the required licensing so you can use other instances of the controls throughout the WPF portions of your project.