# Cognex.Designer.ExampleWinFormsElement

The ExampleWinFormsElement sample plugin provides a template for creating a custom Cognex Designer HMI element that hosts a WinForms control.

A Designer HMI element is a WPF control, so we need to wrap any WinForms control in order to display it. In this sample we demonstrate that using a VisionPro tool edit control, namely, the OCVMaxToolEditor.

Use it as follows:

1. Copy the Cognex.Designer.ExampleWinFormsElement folder into a directory you are developing in.
2. Open the Cognex.Designer.ExampleWinFormsElement solution in Visual Studio.
3. Develop and build your plugin.

Tip: Use the OCVMaxToolEditor.xaml.cs resource as a starting point to wrap other WinForms controls in a Designer HMI element for your plugin.

Cognex Designer makes the built plugin available at the following location:

%ProgramData%\Cognex\Designer\Plugins\Samples\Cognex.Designer.ExampleElement

The plugin should consist of the following files: