C# 将WPF的大小适配到Windows窗体用户控件
使用elementHost方法,我将WPF停靠在Windows窗体用户控件上。两者大小相同,但WPF在用户控件上显示不正确(请参阅)。我做错了什么 WPF代码段:C# 将WPF的大小适配到Windows窗体用户控件,c#,wpf,winforms,visual-studio,user-controls,C#,Wpf,Winforms,Visual Studio,User Controls,使用elementHost方法,我将WPF停靠在Windows窗体用户控件上。两者大小相同,但WPF在用户控件上显示不正确(请参阅)。我做错了什么 WPF代码段: <UserControl x:Class="SlideAnalysis.Views.DesignView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.mic
<UserControl x:Class="SlideAnalysis.Views.DesignView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SlideAnalysis.Views"
mc:Ignorable="d"
Height="586"
Width="431">
你能发布一些代码吗?您正在显示的图像有什么问题?没有太多代码可显示。只是WPF并没有在Winforms UC上完整显示,它可能会将WPF元素的水平对齐
和垂直对齐
设置为拉伸
。我试过了,没有效果。你能发布一些代码吗?您正在显示的图像有什么问题?没有太多代码可显示。只是WPF并没有在Winforms UC上完整显示,它可能会将WPF元素的水平对齐
和垂直对齐
设置为拉伸
。我试过了,没有效果。