Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

display same video on 2 forms

Avatar of delphibeginner
delphibeginnerFlag for Netherlands asked on
Visual Basic Classic.NET ProgrammingDigital Audio
2 Comments1 Solution902 ViewsLast Modified:
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 (or nothing 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.

I use windows mediaplayer version 12 (see code)

Any idea?

Here is the code I use at this moment:
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
ASKER CERTIFIED SOLUTION
Avatar of delphibeginner
delphibeginnerFlag of Netherlands image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers