Quantcast
Viewing all articles
Browse latest Browse all 18858

Hosting an ActiveX Control in WPF

Hello All,

I want set "URL" property of MediaPlayer from XAML with Binding ...

Can anyone please tell me. How to do this.

<UserControl>

<GridName="grid1"></Grid>

</UserControl>

private void UC_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.
    AxWMPLib.AxWindowsMediaPlayer axWmp = new AxWMPLib.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";
}

http://msdn.microsoft.com/en-us/library/ms742735.aspx

Vikas Gupta


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>