none
Chart in Windowsformshost löst Mousewheel Event nicht aus RRS feed

  • Frage

  • Hallo,

    ich versuche einen windows forms chart in meiner WPF Anwendung zu zoomen. Dazu will ich das Mousewheel Event verwenden.

    Allerdings löst dieses nie aus. Das Click und das MouseLeave Event vom Chart funktionieren.

    <Window x:Name="Window" x:Class="winformsinWpf.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wfault ="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"
            Title="MainWindow" Height="350" Width="525">
        
        <Grid Name="grid1">
            <WindowsFormsHost Name="wfh" Width="150" Height="300" >
                <wfault:Chart MouseWheel="Chart_MouseWheel" Click="Chart_Click" BackColor="Aqua" MouseLeave="Chart_MouseLeave"/>
            </WindowsFormsHost>
        </Grid>
        
    </Window>
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using System.Windows.Forms;
    
    namespace winformsinWpf
    {
        /// <summary>
        /// Interaktionslogik für MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
        {
            public MainWindow()
            {
              
            }
    
            private void WF0_Click(object sender, EventArgs e)
            {
                System.Windows.MessageBox.Show(wfh.Child.Text);
            }
    
            private void Chart_MouseWheel(object sender, System.Windows.Forms.MouseEventArgs e)
            {
                System.Windows.MessageBox.Show("Wheel");
            }
    
            private void Chart_Click(object sender, EventArgs e)
            {
                System.Windows.MessageBox.Show("Click");
            }
    
            private void Chart_MouseLeave(object sender, EventArgs e)
            {
                System.Windows.MessageBox.Show("Wheel");
            }
        }
    }
    

    Weiß jemand, wie ich das Mousewheel Event aktiviere?

    Grüße 

    Matthias


    Dienstag, 26. August 2014 11:57

Antworten