Question: I'm trying to use a winform control in WPF(I've not found good alternative).
The control is the be.hexbox from sourceforge: <https://sourceforge.net/projects/hexbox/files/hexbox/>
So I Start a new solution VB.net WPF and add WindowsFormsIntegration.dll reference.
I also add reference to the control dll.

```
<Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       xmlns:wf="clr-namespace:Be.Windows.Forms;assembly=Be.Windows.Forms.HexBox"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp2"

        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>

        <WindowsFormsHost Name="TEST1">

            <wf:HexBox x:Name="HX" />

        </WindowsFormsHost>
    </Grid>
</Window>

```

but I get this error:
Error XLS0502 The 'WindowsFormsHost' type does not support direct content.
Any advice?

Answer: 
Indeed, you can't set a direct `Content` in a `WindowsFormsHost` element, you need to set the `Child` property instead.

Try this:

```
<WindowsFormsHost Name="TEST1">
    <WindowsFormsHost.Child>
        <wf:HexBox x:Name="HX" />
    </WindowsFormsHost.Child>
</WindowsFormsHost>

```
The project must have a reference to **both**:

* WindowsFormsIntegration
* System.Window.Forms

In my experience you do not need to specify <WindowsFormsHost.Child> in XAML. This may be dependent on the version. I am currently using .NET Framework 4.8.