Wpf Windows窗体元素主机焦点
我在Windows窗体用户控件中有一个ElementHost,其大小与Windows窗体用户控件的全宽/全高相同。UserControl位于表单上…但我无法移动UserControl或在设计器中选择它,因为每当我在设计器中鼠标悬停/单击UserControl时,ElementHost的子级就会窃取焦点 如何防止这种情况在设计时发生?我执行了以下操作:Wpf Windows窗体元素主机焦点,wpf,winforms,windows-forms-designer,elementhost,Wpf,Winforms,Windows Forms Designer,Elementhost,我在Windows窗体用户控件中有一个ElementHost,其大小与Windows窗体用户控件的全宽/全高相同。UserControl位于表单上…但我无法移动UserControl或在设计器中选择它,因为每当我在设计器中鼠标悬停/单击UserControl时,ElementHost的子级就会窃取焦点 如何防止这种情况在设计时发生?我执行了以下操作: if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
{
host.Enabled = false;
}
现在,我可以拖动父控件上的UserControl并调整其大小