Chakavak Behzad
Chakavak Behzad

Reputation: 807

Run video in wpf

I want my first project to be implemented in the form of a video, how do I do this? I want to play a video and then when I click on the form, video get stopped and app go to another page. please help me.

Upvotes: 12

Views: 20521

Answers (3)

Yugz
Yugz

Reputation: 677

Its pretty simple just use the MediaElement control in wpf to display your video on your form

Simple WPF Media Player

Upvotes: 1

Ionică Bizău
Ionică Bizău

Reputation: 113335

Using MediaElement control you will can play a video in WFP. XAML code:

<MediaElement Name="VideoControl" Width="200" Height ="400"
                  Source="your_path_to_video_file.wmv" >    
</MediaElement>

It plays MPG files, too: Source="C:\TestV.MPG"

To know how to control it using Play, Stop, Pause buttons click here. It's a good article about this with many examples.

Upvotes: 4

makc
makc

Reputation: 2579

try using MediaElement

<MediaElement Name="VideoControl" 
              Source="C:\my.wmv" >    
</MediaElement>

Upvotes: 19

Related Questions