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)
After : (Button 1 is no longer visible)
Sets the index of the specified child control in the collection to the specified index value.
Control.ControlCollection.SetChildIndex
MethodFor instance if button is inside picture box control then just set:
This will do the job.