关于mediaplayer控件的问题

追求者2 2003-08-26 08:51:13
请问有哪位大虾能在VB中通过控件点击将mediaplayer全屏播放,然后通过任意点击返回原来大小,很急,在线等待
谢谢了
...全文
132 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
追求者2 2003-10-11
  • 打赏
  • 举报
回复
up
追求者2 2003-10-01
  • 打赏
  • 举报
回复
up
rainstormmaster 2003-09-21
  • 打赏
  • 举报
回复
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{22D6F304-B0F6-11D0-94AB-0080C74C7E95}#1.0#0"; "MSDXM.OCX"
Begin VB.Form Form1
Caption = "超级VCD播放器"
ClientHeight = 3435
ClientLeft = 165
ClientTop = 735
ClientWidth = 4980
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3435
ScaleWidth = 4980
StartUpPosition = 3 '窗口缺省
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1000
Left = 120
Top = 480
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 840
Top = 2640
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H80000004&
Caption = "00:00:00"
ForeColor = &H000000FF&
Height = 180
Left = 3840
TabIndex = 1
Top = 0
Width = 720
End
Begin MediaPlayerCtl.MediaPlayer MediaPlayer1
Height = 3375
Left = 240
TabIndex = 0
Top = 0
Width = 4455
AudioStream = -1
AutoSize = 0 'False
AutoStart = -1 'True
AnimationAtStart= -1 'True
AllowScan = -1 'True
AllowChangeDisplaySize= -1 'True
AutoRewind = 0 'False
Balance = 0
BaseURL = ""
BufferingTime = 5
CaptioningID = ""
ClickToPlay = -1 'True
CursorType = 0
CurrentPosition = -1
CurrentMarker = 0
DefaultFrame = ""
DisplayBackColor= 0
DisplayForeColor= 16777215
DisplayMode = 0
DisplaySize = 4
Enabled = -1 'True
EnableContextMenu= -1 'True
EnablePositionControls= -1 'True
EnableFullScreenControls= 0 'False
EnableTracker = -1 'True
Filename = ""
InvokeURLs = -1 'True
Language = -1
Mute = 0 'False
PlayCount = 1
PreviewMode = 0 'False
Rate = 1
SAMILang = ""
SAMIStyle = ""
SAMIFileName = ""
SelectionStart = -1
SelectionEnd = -1
SendOpenStateChangeEvents= -1 'True
SendWarningEvents= -1 'True
SendErrorEvents = -1 'True
SendKeyboardEvents= 0 'False
SendMouseClickEvents= 0 'False
SendMouseMoveEvents= 0 'False
SendPlayStateChangeEvents= -1 'True
ShowCaptioning = 0 'False
ShowControls = -1 'True
ShowAudioControls= -1 'True
ShowDisplay = 0 'False
ShowGotoBar = 0 'False
ShowPositionControls= -1 'True
ShowStatusBar = 0 'False
ShowTracker = -1 'True
TransparentAtStart= 0 'False
VideoBorderWidth= 0
VideoBorderColor= 0
VideoBorder3D = 0 'False
Volume = -600
WindowlessVideo = 0 'False
End
Begin VB.Menu file
Caption = "文件"
Begin VB.Menu fopen
Caption = "打开"
End
Begin VB.Menu exit
Caption = "退出"
End
End
Begin VB.Menu view
Caption = "视频"
Begin VB.Menu option
Caption = "设置"
Begin VB.Menu nommal
Caption = "Nommal Size"
End
Begin VB.Menu double
Caption = "Double Size"
End
End
Begin VB.Menu full
Caption = "全屏"
End
End
Begin VB.Menu waves
Caption = "音频"
Begin VB.Menu chanel
Caption = "声道"
End
Begin VB.Menu vaw
Caption = "音量"
End
End
Begin VB.Menu helpmain
Caption = "帮助"
Begin VB.Menu help
Caption = "帮助主题"
End
Begin VB.Menu about
Caption = "关于"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Private Const DRIVE_CDROM = 5

Dim temp As Integer, hh As Integer, mm As Integer, ss As Integer
Dim MFile As String
Private Sub double_Click()
temp = 2
Form1.Height = 4125 * 2
Form1.Width = 5100 * 2
MediaPlayer1.Width = 4550 * 2 + 480
MediaPlayer1.Height = 3375 * 2 + 850
Label1.Left = MediaPlayer1.Left + MediaPlayer1.Width - Label1.Width
End Sub

Private Sub exit_Click()
End
End Sub

Private Sub fopen_Click()
CommonDialog1.ShowOpen
MFile = CommonDialog1.FileName
MediaPlayer1.FileName = MFile
MediaPlayer1.AutoStart = True
Label1.Caption = "00:00:00"
Timer1.Enabled = True
End Sub

Private Sub Form_Load()
Dim Drivename As String, I As Integer
temp = 1
hh = 0
mm = 0
ss = 0
Form1.Height = 4325
Form1.Width = 5100
MediaPlayer1.Top = 200
MediaPlayer1.Width = 4550
MediaPlayer1.Height = 3375
Label1.Left = MediaPlayer1.Left + MediaPlayer1.Width - Label1.Width
CommonDialog1.Filter = "影像文件(*.Avi;*.Mpg;*.Dat)|*.Avi;*.MPG;*.DAT"
On Error Resume Next
Drivename = ""
' 查找CD-ROM的驱动器号
For I = 65 To 90
If GetDriveType(Chr$(I) & ":\") = DRIVE_CDROM Then
Drivename = Chr$(I) & ":"
Exit For
End If
Next
If Drivename = "" Then
A = MsgBox("找不到 CD-ROM !", 0 + 16, "提示信息")
Else
MFile = Drivename + "\Mpegav\Music01.dat"
MediaPlayer1.FileName = MFile
MediaPlayer1.AutoStart = True
Label1.Caption = "00:00:00"
Timer1.Enabled = True

End If
End Sub

Private Sub Form_Resize()
If temp = 1 Then
Form1.Height = 4325
Form1.Width = 5100
MediaPlayer1.Width = 4550
MediaPlayer1.Height = 3375
Label1.Left = MediaPlayer1.Left + MediaPlayer1.Width - Label1.Width
Else
Form1.Height = 4325 * 2
Form1.Width = 5100 * 2
MediaPlayer1.Width = 4550 * 2 + 480
MediaPlayer1.Height = 3375 * 2 + 850
Label1.Left = MediaPlayer1.Left + MediaPlayer1.Width - Label1.Width
End If
End Sub

Private Sub full_Click()
If full.Checked = False Then
full.Checked = True
MediaPlayer1.EnableFullScreenControls = True

Else
full.Checked = False
MediaPlayer1.EnableFullScreenControls = False

End If
End Sub

Private Sub MediaPlayer1_PlayStateChange(ByVal OldState As Long, ByVal NewState As Long)
If NewState = 1 Then Timer1.Enabled = False
If NewState = 2 Then Timer1.Enabled = True
If NewState = 0 Then
Timer1.Enabled = False
hh = 0
ss = 0
mm = 0
End If

End Sub

Private Sub nommal_Click()
temp = 1
Form1.Height = 4125
Form1.Width = 5100
MediaPlayer1.Width = 4550
MediaPlayer1.Height = 3375
End Sub


Private Sub Timer1_Timer()
ss = ss + 1
If ss >= 60 Then
mm = mm + 1
ss = 0
If mm >= 60 Then
hh = hh + 1
mm = 0
End If
End If
Label1.Caption = Format$(hh, "00") + ":" + Format$(mm, "00") + ":" + Format$(ss, "00")
End Sub
追求者2 2003-09-21
  • 打赏
  • 举报
回复
up
追求者2 2003-09-09
  • 打赏
  • 举报
回复
up
追求者2 2003-09-08
  • 打赏
  • 举报
回复
up
网上我也找过好几次了,找不到关于这个问题的方法
junki 2003-08-29
  • 打赏
  • 举报
回复
具体怎么实现我也不记得了
但网上很多这样的资料啊
怎么不去看一看呢?
相信对你会有帮助的
……
追求者2 2003-08-27
  • 打赏
  • 举报
回复
up
冰山来客123499 2003-08-27
  • 打赏
  • 举报
回复
有一个全屏幕播放的方法的。拦截WM_LBUTTONDOWN消息,然后处理之,就可以了!
追求者2 2003-08-26
  • 打赏
  • 举报
回复
那怎样处理才能用鼠标点击变回原样呢
不能用键盘,也不能用鼠标右键啊,只能用左键有什么办法吗
zymfy 2003-08-26
  • 打赏
  • 举报
回复
Private Sub Command1_Click()
Me.MediaPlayer1.Top = 0
Me.MediaPlayer1.Left = 0
Me.MediaPlayer1.Width = Me.ScaleWidth
Me.MediaPlayer1.Height = Me.ScaleHeight
End Sub
hxy2003 2003-08-26
  • 打赏
  • 举报
回复
UP
追求者2 2003-08-26
  • 打赏
  • 举报
回复
能详细点吗,谢谢啦,急啊
sworddx 2003-08-26
  • 打赏
  • 举报
回复
拦wm_lbuttondown消息。

____________________________________________
.:RNPA:.Royal Networks Programmers' Alliance

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧