wpfwinformswindows-forms-designerelementhost

I can't move a UserControl containing full-size ElementHost in the Windows Forms designer?


I have an ElementHost in a Windows Forms UserControl that is sized to the full width/height of the Windows Forms UserControl. The UserControl is on a Form...but I can't move the UserControl or select it in the Designer, because the Child of the ElementHost steals focus whenever I mouse over/click the UserControl in the Designer.

How can I prevent this from happening at Design time?


Solution

  • I did the following:

            if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
            {
                host.Enabled = false;
            }
    

    which now allows me to drag and resize the UserControl on the parent.