I've been trying to create a simple program with vb 2010 to play video's (when you use multiple screens) on the main screen (with controls) and the full screen (with no controls) on the second screen.
I get it to work that I can open the second screen and play a video, but the video is only played on the main screen and audio is played on the second screen.
I want to play the video on the main screen as well as on the second screen at the same time.
Any idea?
Here is the code I use at this moment:
I get it to work that I can open the second screen and play a video, but the video is only played on the main screen and audio is played on the second screen.
I want to play the video on the main screen as well as on the second screen at the same time.
Any idea?
Here is the code I use at this moment:
VB.NET:
Public Class MainForm
Private Sub ToolStripButton1_CheckStateChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.CheckStateChanged
If ToolStripButton1.CheckState = CheckState.Checked Then
Dim screen As Screen
'Show second form on second screen
screen = screen.AllScreens(1)
SecondForm.StartPosition = FormStartPosition.Manual
SecondForm.Location = screen.Bounds.Location + New Point(100, 100)
SecondForm.Show()
Me.Select()
Else
SecondForm.Close()
ToolStripButton1.CheckState = CheckState.Unchecked
End If
End Sub
Private Sub OpenVideoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenVideoToolStripMenuItem.Click
OpenFileDialog1.ShowDialog()
AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
SecondForm.AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AxWindowsMediaPlayer1.Ctlcontrols.play()
SecondForm.AxWindowsMediaPlayer1.Ctlcontrols.play()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
AxWindowsMediaPlayer1.Ctlcontrols.pause()
SecondForm.AxWindowsMediaPlayer1.Ctlcontrols.pause()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
AxWindowsMediaPlayer1.Ctlcontrols.stop()
SecondForm.AxWindowsMediaPlayer1.Ctlcontrols.stop()
End Sub
Private Sub Slider1_DecreaseButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Slider1.DecreaseButtonClick
AxWindowsMediaPlayer1.settings.volume = AxWindowsMediaPlayer1.settings.volume - 10
End Sub
Private Sub Slider1_IncreaseButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Slider1.IncreaseButtonClick
AxWindowsMediaPlayer1.settings.volume = AxWindowsMediaPlayer1.settings.volume + 10
End Sub
Private Sub Slider1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Slider1.MouseMove
AxWindowsMediaPlayer1.settings.volume = Slider1.Value
End Sub
End Class