dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.04k stars 1.16k forks source link

WPF程序调用winform的控件无法设置Zindex #6121

Closed yutengRen closed 2 years ago

yutengRen commented 2 years ago

使用Microsoft.DwayneNeed.dll这个DLL才能在WPF中设置winform控件的Zindex。 但是这个DLL有个bug,就是创建了几十次控件后窗体上就会有个阴影。 这个问题有办法能解决吗?

miloush commented 2 years ago

Google Translate:

Use the DLL Microsoft.DwayneNeed.dll to set the Zindex of the winform control in WPF. But this DLL has a bug, that is, after creating dozens of controls, there will be a shadow on the form. Is there a way to solve this problem?

Microsoft.DwayneNeed.dll is not part of WPF so I don't expect anyone here would be able to fix any issues with it.

Do you have any code that shows the problem?

yutengRen commented 2 years ago

Google Translate:

Use the DLL Microsoft.DwayneNeed.dll to set the Zindex of the winform control in WPF. But this DLL has a bug, that is, after creating dozens of controls, there will be a shadow on the form. Is there a way to solve this problem?

Microsoft.DwayneNeed.dll is not part of WPF so I don't expect anyone here would be able to fix any issues with it.

Do you have any code that shows the problem?

<UserControl x:Class="WpfApplication1.UserControl1" 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:WpfApplication1" mc:Ignorable="d" xmlns:airspace="clr-namespace:Microsoft.DwayneNeed.Interop;assembly=Microsoft.DwayneNeed" Loaded="UserControl_Loaded"

    <!--<WindowsFormsHost x:Name="WindowsFormsHost1" Background="Red" VerticalAlignment="Top" HorizontalAlignment="Left"  Height="300" Width="500" >
    </WindowsFormsHost>-->
</Grid>

只有这样才能设置WindowsFormsHost1的Zindex,否则winform的控件会一直显示在最上层

gurpreet-wpf commented 2 years ago

@yutengRen Please attach a sample repro to investigate this.

pchaurasia14 commented 2 years ago

In absence of sample repro, we're closing this issue. If this is still a problem, feel free to file a new ticket.