Results 1 to 4 of 4

Thread: WMP on second form won't play in fullscreen

  1. #1
    ud2008 is offline VB.NET Forum Fanatic
    .NET Framework
    .NET 4.0
    Join Date
    Jul 2010
    Posts
    148
    Reputation
    40

    WMP on second form won't play in fullscreen

    I have this program, created with vb2010, to play video on the main screen and on a second screen. This works, but I don't get the second screen WMP to play at fullscreen, it just stays at normal size.
    The second is not a pre-designed form, it's created when I click on a button, and then the WMP is added to the form as control.

    Here is the code I have:
    Code:
    Dim musiclocation As New ArrayList
        Dim scform As New Form
        Dim screen As Screen
        Dim mediaplayer As New AxWMPLib.AxWindowsMediaPlayer
    
    Private Sub SwitchButton1_ValueChanged(sender As System.Object, e As System.EventArgs) Handles SwitchButton1.ValueChanged
            If SwitchButton1.Value = True Then
                scform.Controls.Add(mediaplayer)
                mediaplayer.Dock = DockStyle.Fill
                screen = screen.AllScreens(1)
                scform.ShowInTaskbar = True
                scform.StartPosition = FormStartPosition.Manual
                scform.Location = screen.Bounds.Location + New Point(100, 100)
                scform.WindowState = FormWindowState.Maximized
                scform.FormBorderStyle = Windows.Forms.FormBorderStyle.None
                scform.Show()
                mediaplayer.uiMode = "none"
                mediaplayer.Dock = DockStyle.Fill
                'mediaplayer.fullScreen = True
                If ListBox1.Items.Count > 0 Then
                    PlayButton.Enabled = True
                    ListBox1.Enabled = True
                ElseIf ListBox1.Items.Count = 0 Then
                    ListBox1.Enabled = False
                    PlayButton.Enabled = False
                End If
            Else
                scform.Hide()
                mediaplayer.Ctlcontrols.stop()
                Player.Ctlcontrols.stop()
                PlayButton.Enabled = False
                PauseButton.Enabled = False
                StopButton.Enabled = False
                ListBox1.Enabled = False
                If CheckBox1.Checked = True Then
                    CheckBox1.Checked = False
                    CheckBox1.Enabled = False
                End If
            End If
        End Sub
    
    Private Sub PlayButton_Click(sender As System.Object, e As System.EventArgs) Handles PlayButton.Click
            Try
                If ListBox1.SelectedItem = Nothing Then
                    MsgBox("Select media to play")
                Else
                    CheckBox1.Enabled = True
                    mediaplayer.Ctlcontrols.play()
                    Player.Ctlcontrols.play()
                    Timer1.Start()
                    Player.settings.volume = Player.settings.mute
                    StopButton.Enabled = True
                    PauseButton.Enabled = True
                    PlayButton.Enabled = False
                    Me.Select()
                End If
                If mediaplayer.playState = WMPLib.WMPPlayState.wmppsPlaying Then
                    mediaplayer.fullScreen = True
                End If
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
        End Sub
    Any help would be great.

    Thanks.

  2. #2
    ud2008 is offline VB.NET Forum Fanatic
    .NET Framework
    .NET 4.0
    Join Date
    Jul 2010
    Posts
    148
    Reputation
    40
    anyone an idea?

  3. #3
    ud2008 is offline VB.NET Forum Fanatic
    .NET Framework
    .NET 4.0
    Join Date
    Jul 2010
    Posts
    148
    Reputation
    40
    Anyone? Everytime when I start to play a video file, the second screen goes black.

  4. #4
    ud2008 is offline VB.NET Forum Fanatic
    .NET Framework
    .NET 4.0
    Join Date
    Jul 2010
    Posts
    148
    Reputation
    40
    I solved it, it wasn't the screen that went black, but the the thumbnail in the startbar (on windows 7).

    This question can be marked as solved.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking