csharp System.Windows.Forms.Integration.WindowsFormsHost.Child类(方法)实例源码

下面列出了csharp System.Windows.Forms.Integration.WindowsFormsHost.Child 类(方法)源码代码实例,从而了解它的用法。

作者:.NET开发    项目:System.Windows.Forms.Integratio   
private void Window_Loaded(object sender, RoutedEventArgs e) 
{
    // Create the interop host control.
    System.Windows.Forms.Integration.WindowsFormsHost host =
        new System.Windows.Forms.Integration.WindowsFormsHost();

    // Create the ActiveX control.
    WmpAxLib.AxWindowsMediaPlayer axWmp = new WmpAxLib.AxWindowsMediaPlayer();

    // Assign the ActiveX control as the host control's child.
    host.Child = axWmp;

    // Add the interop host control to the Grid
    // control's collection of child controls.
    this.grid1.Children.Add(host);

    // Play a .wav file with the ActiveX control.
    axWmp.URL = @"C:\Windows\Media\tada.wav";
}


问题


面经


文章

微信
公众号

扫码关注公众号