Quantcast
Channel: VBForums - WPF, WCF, WF
Viewing all articles
Browse latest Browse all 256

Using WPF Controls in Windows Forms

$
0
0
Hello,

I am trying to make a video player in Visual Basic.NET (visual studio 2012) without using the built in Windows media player.
I saw somewhere that you can create a WPF user control with a MediaElement and then use that in a Windows Form.

Unfortunately i have had very little success in creating my own working control.

I made a WPF User Control Library and made a new user control there with the MediaElement, then proceeded with a Windows Form and placed the MediaElement on it, now comes my problem.
I cannot seem to access the properties of my MediaElement or i am trying in the wrong way.
In particular the source property to add a URI so i can actually play a movie file.

Even when i am trying to access these from .xaml.vb it seems i am doing something wrong.

So i am hoping if someone could show me/tell me exactly what i should be doing to make this work (yes sounds lazy but i swear im not)

I don't have a lot of experience with WPF yet.

Just to tell you what i did.
  • Made project - WPF control Library
  • Added New control
  • Placed a MediaElement on the grid
  • Built the project
  • Made a project for my windows forms
  • Dragged the MediaElement on the form
  • Added a menu bar with some code to open a dialog to select a movie file
  • Attempting to add the movie file to MediaElement source as URI


I have tried every namespace i think makes sense to access the source property but i must be doing something wrong.

Viewing all articles
Browse latest Browse all 256

Trending Articles



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