首先,我为我的英语基础薄弱道歉我想在弹出窗口中显示我的 win 表单用户控件,但这没有显示 WinFormElementHost!我该怎么办?
编辑:
这是我的代码,用于定义弹出窗口的 xaml 代码和我的用户控件类
<Popup Name="popupDate" PopupAnimation="Scroll" Width="310" Height="310"
PlacementTarget="{Binding ElementName=buttonDate}"
AllowsTransparency="True" Margin="8,-36,-29,-13">
<Canvas Background="Transparent">
<Canvas Background="LightBlue" Width="300" Height="300">
<Canvas.BitmapEffect>
<DropShadowBitmapEffect Softness=".3"
ShadowDepth=".5"
Color="Black"/>
</Canvas.BitmapEffect>
<WindowsFormsHost Height="200" HorizontalAlignment="Left" Margin="0,0,0,0" Name="windowsFormsHost1" VerticalAlignment="Top" Width="200"/>
</Canvas>
</Canvas>
</Popup>
public partial class SearchBaseDateAndDuration : UserControl
{
Persian_Calender.Persian_Calender pc;
public SearchBaseDateAndDuration()
{
InitializeComponent();
pc = new Persian_Calender.Persian_Calender();
windowsFormsHost1.Child = pc;
}
}
感谢您的关注
祝你好运