1

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?

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Jeff
  • 35,755
  • 15
  • 108
  • 220

1 Answers1

2

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.

Jeff
  • 35,755
  • 15
  • 108
  • 220