PopupButton: WindowsFormsHost in PopupContent doesn't work

Editors for WPF Forum

Posted 12 years ago by Marcin Szotka
Version: 12.2.0570
Platform: .NET 4.5
Environment: Windows 8 (64-bit)
Avatar

Simple example of problem:

 

<Window x:Class="ActiProProblem.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" Title="MainWindow" Height="350" Width="525">
<DockPanel>
<shared:PopupButton DisplayMode="PopupOnly"
PopupAnimation="None"
IsEnabled="True"
Grid.Column="2"
Grid.Row="2"
Margin="1"
HorizontalAlignment="Left"
VerticalAlignment="Center"
HorizontalContentAlignment="Center">
<shared:PopupButton.PopupContent>
<DockPanel Background="Chartreuse"
Width="320"
Height="240">
<WindowsFormsHost Background="DeepPink" Width="320" Height="240">
<wf:TreeView Width="320"
Height="240"/>
</WindowsFormsHost>

</DockPanel>

</shared:PopupButton.PopupContent>
</shared:PopupButton>
</DockPanel>
</Window>

 

Run application, click popup button. Where is my WindowsFormsHost and its content?

 

Best regards - Marcin Szotka, InstalSoft

Comments (1)

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Marcin,

The problem there is the WPF/WinForms airspace issue.  The Popup we use to show the popup content has AllowsTransparency set to true so that we can do drop shadows.  But unfortunately in WPF when that is set on, WinForms content won't render.

What we'll do is add a new PopupButton.PopupAllowsTransparency property for the next maintenance release that you can set to false to allow your WinForms content to show.


Actipro Software Support

The latest build of this product (v24.1.2) was released 0 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.