Note that there are some explanatory texts on larger screens.

plurals
  1. POMy WPF UserControl doesn't receive input when hosted in a WinForm Form
    primarykey
    data
    text
    <p>I've added a WPF user control to a WinForms Form but I'm not able to receive events on my WPF control.</p> <p>I've tried to subscribe the MouseEnter event but the event handler method is never called. I'm adding the WPF control with the Visual Studio (2010 Express edition) designer. I add an ElementHost and then associate my control to the host.</p> <p>Here is a screenshot of the form:</p> <p><img src="https://i.stack.imgur.com/7KdUz.png" alt="enter image description here"></p> <p>The WPF control is an help ad below toolstrip. There is a link at the end of the control that, when added to the winform elementhost, won't receive any input events.</p> <p>Here is the xaml code of the component:</p> <pre><code>&lt;UserControl x:Class="Telbit.TeStudio.View.Forms.HelpAd" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="30" Width="500" x:Name="HelpAdControl" Background="#FFD3DCE6" BorderBrush="#FFB9C4D2" BorderThickness="0 0 0 1"&gt; &lt;Grid&gt; &lt;StackPanel Orientation="Horizontal"&gt; &lt;Image Name="icnHelpAd" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding ElementName=HelpAdControl, Path=HasIcon}"/&gt; &lt;TextBlock Name="txtHelpType" Margin="5 0 0 0" Visibility="{Binding ElementName=HelpAdControl, Path=HasType}" Text="{Binding ElementName=HelpAdControl, Path=HelpType}" TextBlock.FontFamily="Verdana" TextBlock.FontSize="10" FontWeight="Bold" Foreground="#FF939FBB" VerticalAlignment="Center" /&gt; &lt;TextBlock Name="txtHelpDescription" Margin="5 0 0 0" Visibility="{Binding ElementName=HelpAdControl, Path=HasDescription}" Text="{Binding ElementName=HelpAdControl, Path=HelpDescription}" TextBlock.FontFamily="Verdana" TextBlock.FontSize="10" Foreground="#FF444444" VerticalAlignment="Center" /&gt; &lt;TextBlock Name="lblHelpLink" VerticalAlignment="Center" Margin="5 0 0 0"&gt; &lt;Hyperlink Name="lnkHelpLink" TextBlock.FontFamily="Verdana" TextBlock.FontSize="10" Foreground="#FF255BC8" Click="lnkHelpLink_Click" NavigateUri="{Binding ElementName=HelpAdControl, Path=HelpKey}"&gt; &lt;TextBlock Text="{Binding ElementName=HelpAdControl, Path=HelpLinkDescription}" /&gt; &lt;/Hyperlink&gt; &lt;/TextBlock&gt; &lt;TextBlock Name="lblNextHelp" Margin="5 0 0 0" Width="16" VerticalAlignment="Center" HorizontalAlignment="Right" ToolTip="Next Help Tip" TextBlock.FontFamily="Verdana" TextBlock.FontSize="10"&gt; &lt;Hyperlink Name="lnkNextHelp" Click="lnkNextHelp_Click" NavigateUri="www.mock.com"&gt; » &lt;/Hyperlink&gt; &lt;/TextBlock&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; </code></pre> <p></p> <p>Just another note: the mouse cursor is not changed when the mouse is hover the link component. It seems to me that the events are not being send to WPF control.</p> <p>Any idea of waht may be causing this problem?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload