How to put other controls on top of the video?

972 Views Asked by At

I am using mciSendString to play a video but I am unable to put any control like labels or buttons on top of the video. How do I put another control on top of the video ?

Below is the code:

Public Class Form1

Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer,ByVal hwndCallback As Integer) As Integer

Dim filename As String

Dim retVal As Integer

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    filename = Chr(34) & "D:\farm.wmv" & Chr(34)
    retVal = mciSendString("open " & filename & " type mpegvideo alias movie parent " & Panel1.Handle.ToInt32 & " style child", 0, 0, 0)

    retVal = mciSendString("put movie window at 0 0 201 127", 0, 0, 0)
    retVal = mciSendString("play movie", 0, 0, 0)
 End Sub   End Class

Before : (Button 1 is visible)

enter image description here

After : (Button 1 is no longer visible)

enter image description here

1

There are 1 best solutions below

0
On

Sets the index of the specified child control in the collection to the specified index value.

Control.ControlCollection.SetChildIndex Method

For instance if button is inside picture box control then just set:

PictureBox.Controls.Setchildindex(control,newIndex)

This will do the job.