1

我正在使用 mciSendString 播放视频,但我无法在视频顶部放置任何控件,例如标签或按钮。如何在视频顶部放置另一个控件?

下面是代码:

公开课形式1

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 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

之前:(按钮 1 可见)

在此处输入图像描述

之后:(按钮 1 不再可见)

在此处输入图像描述

4

1 回答 1

0

将集合中指定子控件的索引设置为指定的索引值。

Control.ControlCollection.SetChildIndex方法

例如,如果按钮在图片框控件内,则只需设置:

PictureBox.Controls.Setchildindex(control,newIndex)

这将完成这项工作。

于 2013-11-19T07:16:24.537 回答