WPFをWinformでホストするとリサイズ時に黒枠が出てしまう問題の回避?

As you can see from the screenshot above this causes an annoying background color problem. It turns out that the background of the WPF user control becomes black. I tried to change the BackColor and BackColorTransparent properties of the ElementHost object but this didn't solve it. Setting BackColor to Color.Red or SystemColors.Highlight works fine, but setting it to SystemColors.Control will turn the background into black. Normally this should work because the ElementHost class has several mapped properties like color, font, cursor, ...

To solve the problem, I assigned a new SolidColorBrush object to the Background property of my WPF user control. Therefore I needed to convert a System.Drawing.Color (WinForms) to a System.Windows.Media.Color (WPF).

Color color = SystemColors.Control;
wpfUsercontrol.Background = new System.Windows.Media.SolidColorBrush(
System.Windows.Media.Color.FromRgb(color.R, color.G, color.B));