i have a Forms.DataVisualization.Charting.Chart in a WindowsFormsHost. I can't get the chart to receive mouse wheel events. Clicks are working, if i try with a Forms.TextBox the mouse wheel is working, too. The mouse wheel is also working if i use the chart in a "native" forms app.
So, what makes the problem is the combination of the forms chart in a formsHost.
Here is a verry simple application to replicate the problem:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="TextBlock1" Grid.Column="1" />
<WindowsFormsHost Name="WindowsFormsHost1" Grid.Column="0"/>
</Grid>
and the code behind:
public MainWindow()
{
InitializeComponent();
var chart = new Chart() { BackColor = System.Drawing.Color.Aquamarine};
WindowsFormsHost1.Child = chart;
chart.MouseDown += (a, b) => TextBlock1.Text += "FORMS click\r\n";
TextBlock1.MouseDown += (a, b) => TextBlock1.Text += "WPF click\r\n";
chart.MouseWheel += (a, b) => TextBlock1.Text += "FORMS wheel\r\n";
TextBlock1.MouseWheel += (a, b) => TextBlock1.Text += "WPF wheel\r\n";
}
i can receive all clicks and the mouse wheel from wpf, but no wheel from forms. I tried the wheel listener of the formsHost as well, without success.
Any ideas? Jon Skeet?
Any ideas? Jon Skeet?
This should be upgraded to "meme" status!!! – Pickerelweed