⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 play1.vb

📁 这是一本用Visual Studio.NET进行多媒体编程的读物
💻 VB
📖 第 1 页 / 共 2 页
字号:
Option Strict Off
Option Explicit On
Friend Class Form1
	Inherits System.Windows.Forms.Form
#Region "Windows 窗体设计器生成的代码"
	Public Sub New()
		MyBase.New()
		If m_vb6FormDefInstance Is Nothing Then
			If m_InitializingDefInstance Then
				m_vb6FormDefInstance = Me
			Else
				Try 
					'对于启动窗体,所创建的第一个实例为默认实例。
					If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
						m_vb6FormDefInstance = Me
					End If
				Catch
				End Try
			End If
		End If
		'此调用是 Windows 窗体设计器所必需的。
		InitializeComponent()
	End Sub
	'窗体重写处置,以清理组件列表。
	Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
		If Disposing Then
			If Not components Is Nothing Then
				components.Dispose()
			End If
		End If
		MyBase.Dispose(Disposing)
	End Sub
    Private components As System.ComponentModel.IContainer
	'Windows 窗体设计器所必需的
		Public ToolTip1 As System.Windows.Forms.ToolTip
	Public WithEvents CommonDialog1 As AxMSComDlg.AxCommonDialog
	Public WithEvents MC As AxMCI.AxMMControl
	Public WithEvents about As System.Windows.Forms.Button
	Public WithEvents Timer1 As System.Windows.Forms.Timer
	Public WithEvents dall As System.Windows.Forms.Button
	Public WithEvents add_Renamed As System.Windows.Forms.Button
	Public WithEvents Delete As System.Windows.Forms.Button
	Public WithEvents List1 As System.Windows.Forms.ListBox
	Public WithEvents Combo1 As System.Windows.Forms.ComboBox
	Public WithEvents File1 As Microsoft.VisualBasic.Compatibility.VB6.FileListBox
	Public WithEvents Dir1 As Microsoft.VisualBasic.Compatibility.VB6.DirListBox
	Public WithEvents Drive1 As Microsoft.VisualBasic.Compatibility.VB6.DriveListBox
	Public WithEvents Exitb As System.Windows.Forms.Button
	Public WithEvents Closeb As System.Windows.Forms.Button
	Public WithEvents Openb As System.Windows.Forms.Button
	Public WithEvents Image1 As System.Windows.Forms.PictureBox
	Public WithEvents Label2 As System.Windows.Forms.Label
	Public WithEvents Label1 As System.Windows.Forms.Label
	'注意:以下过程是 Windows 窗体设计器所必需的
	'可以使用 Windows 窗体设计器来修改它。
	'不要使用代码编辑器来修改它。
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
        Me.Drive1 = New Microsoft.VisualBasic.Compatibility.VB6.DriveListBox()
        Me.List1 = New System.Windows.Forms.ListBox()
        Me.Closeb = New System.Windows.Forms.Button()
        Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
        Me.Combo1 = New System.Windows.Forms.ComboBox()
        Me.Openb = New System.Windows.Forms.Button()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Image1 = New System.Windows.Forms.PictureBox()
        Me.MC = New AxMCI.AxMMControl()
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.dall = New System.Windows.Forms.Button()
        Me.Dir1 = New Microsoft.VisualBasic.Compatibility.VB6.DirListBox()
        Me.File1 = New Microsoft.VisualBasic.Compatibility.VB6.FileListBox()
        Me.Exitb = New System.Windows.Forms.Button()
        Me.CommonDialog1 = New AxMSComDlg.AxCommonDialog()
        Me.Delete = New System.Windows.Forms.Button()
        Me.add_Renamed = New System.Windows.Forms.Button()
        Me.about = New System.Windows.Forms.Button()
        CType(Me.MC, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.CommonDialog1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Drive1
        '
        Me.Drive1.BackColor = System.Drawing.SystemColors.Window
        Me.Drive1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Drive1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.Drive1.DropDownWidth = 401
        Me.Drive1.ForeColor = System.Drawing.SystemColors.WindowText
        Me.Drive1.Location = New System.Drawing.Point(276, 83)
        Me.Drive1.Name = "Drive1"
        Me.Drive1.Size = New System.Drawing.Size(401, 22)
        Me.Drive1.TabIndex = 3
        '
        'List1
        '
        Me.List1.BackColor = System.Drawing.SystemColors.Window
        Me.List1.Cursor = System.Windows.Forms.Cursors.Default
        Me.List1.ForeColor = System.Drawing.SystemColors.WindowText
        Me.List1.ItemHeight = 12
        Me.List1.Location = New System.Drawing.Point(287, 426)
        Me.List1.Name = "List1"
        Me.List1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.List1.Size = New System.Drawing.Size(298, 64)
        Me.List1.TabIndex = 7
        '
        'Closeb
        '
        Me.Closeb.BackColor = System.Drawing.SystemColors.Control
        Me.Closeb.Cursor = System.Windows.Forms.Cursors.Default
        Me.Closeb.Location = New System.Drawing.Point(451, 379)
        Me.Closeb.Name = "Closeb"
        Me.Closeb.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Closeb.Size = New System.Drawing.Size(62, 20)
        Me.Closeb.TabIndex = 1
        Me.Closeb.Text = "Close"
        '
        'Timer1
        '
        Me.Timer1.Enabled = True
        Me.Timer1.Interval = 1
        '
        'Combo1
        '
        Me.Combo1.BackColor = System.Drawing.SystemColors.Window
        Me.Combo1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Combo1.DropDownWidth = 145
        Me.Combo1.ForeColor = System.Drawing.SystemColors.WindowText
        Me.Combo1.Location = New System.Drawing.Point(276, 342)
        Me.Combo1.Name = "Combo1"
        Me.Combo1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Combo1.Size = New System.Drawing.Size(145, 20)
        Me.Combo1.TabIndex = 6
        Me.Combo1.Text = "MP3"
        '
        'Openb
        '
        Me.Openb.BackColor = System.Drawing.SystemColors.Control
        Me.Openb.Cursor = System.Windows.Forms.Cursors.Default
        Me.Openb.Location = New System.Drawing.Point(328, 379)
        Me.Openb.Name = "Openb"
        Me.Openb.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Openb.Size = New System.Drawing.Size(62, 20)
        Me.Openb.TabIndex = 0
        Me.Openb.Text = "Open"
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.BackColor = System.Drawing.Color.White
        Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label1.ForeColor = System.Drawing.Color.Black
        Me.Label1.Location = New System.Drawing.Point(256, 222)
        Me.Label1.Name = "Label1"
        Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label1.Size = New System.Drawing.Size(42, 14)
        Me.Label1.TabIndex = 12
        Me.Label1.Text = "970128"
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(128, Byte), CType(0, Byte))
        Me.Label2.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label2.Location = New System.Drawing.Point(287, 407)
        Me.Label2.Name = "Label2"
        Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label2.Size = New System.Drawing.Size(48, 14)
        Me.Label2.TabIndex = 13
        Me.Label2.Text = "No File"
        '
        'Image1
        '
        Me.Image1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Image1.Image = CType(resources.GetObject("Image1.Image"), System.Drawing.Bitmap)
        Me.Image1.Location = New System.Drawing.Point(133, 268)
        Me.Image1.Name = "Image1"
        Me.Image1.Size = New System.Drawing.Size(30, 27)
        Me.Image1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.Image1.TabIndex = 15
        Me.Image1.TabStop = False
        Me.Image1.Visible = False
        '
        'MC
        '
        Me.MC.Enabled = True
        Me.MC.Location = New System.Drawing.Point(440, 342)
        Me.MC.Name = "MC"
        Me.MC.OcxState = CType(resources.GetObject("MC.OcxState"), System.Windows.Forms.AxHost.State)
        Me.MC.Size = New System.Drawing.Size(236, 29)
        Me.MC.TabIndex = 14
        '
        'dall
        '
        Me.dall.BackColor = System.Drawing.SystemColors.Control
        Me.dall.Cursor = System.Windows.Forms.Cursors.Default
        Me.dall.Location = New System.Drawing.Point(594, 481)
        Me.dall.Name = "dall"
        Me.dall.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.dall.Size = New System.Drawing.Size(73, 20)
        Me.dall.TabIndex = 10
        Me.dall.Text = "DelAll"
        '
        'Dir1
        '
        Me.Dir1.BackColor = System.Drawing.SystemColors.Window
        Me.Dir1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Dir1.ForeColor = System.Drawing.Color.Black
        Me.Dir1.IntegralHeight = False
        Me.Dir1.Location = New System.Drawing.Point(276, 120)
        Me.Dir1.Name = "Dir1"
        Me.Dir1.Size = New System.Drawing.Size(145, 218)
        Me.Dir1.TabIndex = 4
        '
        'File1
        '
        Me.File1.BackColor = System.Drawing.SystemColors.Window
        Me.File1.Cursor = System.Windows.Forms.Cursors.Default
        Me.File1.ForeColor = System.Drawing.SystemColors.WindowText
        Me.File1.ItemHeight = 12
        Me.File1.Location = New System.Drawing.Point(430, 120)
        Me.File1.Name = "File1"
        Me.File1.Pattern = "*.*"
        Me.File1.Size = New System.Drawing.Size(247, 208)
        Me.File1.TabIndex = 5
        '
        'Exitb
        '
        Me.Exitb.BackColor = System.Drawing.SystemColors.Control
        Me.Exitb.Cursor = System.Windows.Forms.Cursors.Default
        Me.Exitb.Location = New System.Drawing.Point(563, 379)
        Me.Exitb.Name = "Exitb"
        Me.Exitb.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Exitb.Size = New System.Drawing.Size(63, 20)
        Me.Exitb.TabIndex = 2
        Me.Exitb.Text = "Exit"
        '
        'CommonDialog1
        '
        Me.CommonDialog1.Enabled = True
        Me.CommonDialog1.Location = New System.Drawing.Point(133, 342)
        Me.CommonDialog1.Name = "CommonDialog1"
        Me.CommonDialog1.OcxState = CType(resources.GetObject("CommonDialog1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.CommonDialog1.Size = New System.Drawing.Size(32, 32)
        Me.CommonDialog1.TabIndex = 0
        '
        'Delete
        '
        Me.Delete.BackColor = System.Drawing.SystemColors.Control
        Me.Delete.Cursor = System.Windows.Forms.Cursors.Default
        Me.Delete.Location = New System.Drawing.Point(594, 454)
        Me.Delete.Name = "Delete"
        Me.Delete.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Delete.Size = New System.Drawing.Size(73, 19)
        Me.Delete.TabIndex = 8
        Me.Delete.Text = "Delete"
        '
        'add_Renamed
        '
        Me.add_Renamed.BackColor = System.Drawing.SystemColors.Control
        Me.add_Renamed.Cursor = System.Windows.Forms.Cursors.Default
        Me.add_Renamed.Location = New System.Drawing.Point(594, 426)
        Me.add_Renamed.Name = "add_Renamed"
        Me.add_Renamed.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.add_Renamed.Size = New System.Drawing.Size(73, 19)
        Me.add_Renamed.TabIndex = 9
        Me.add_Renamed.Text = "Add"
        '
        'about
        '
        Me.about.BackColor = System.Drawing.SystemColors.Control
        Me.about.Cursor = System.Windows.Forms.Cursors.Default
        Me.about.Location = New System.Drawing.Point(440, 46)
        Me.about.Name = "about"
        Me.about.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.about.Size = New System.Drawing.Size(73, 29)
        Me.about.TabIndex = 11
        Me.about.Text = "About"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(128, Byte), CType(0, Byte))
        Me.ClientSize = New System.Drawing.Size(1013, 662)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.CommonDialog1, Me.MC, Me.about, Me.dall, Me.add_Renamed, Me.Delete, Me.List1, Me.Combo1, Me.File1, Me.Dir1, Me.Drive1, Me.Exitb, Me.Closeb, Me.Openb, Me.Image1, Me.Label2, Me.Label1})
        Me.Cursor = System.Windows.Forms.Cursors.Cross
        Me.ForeColor = System.Drawing.Color.White
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Location = New System.Drawing.Point(4, 23)
        Me.Name = "Form1"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
        Me.Text = "MulMedia Player"
        CType(Me.MC, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.CommonDialog1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub
#End Region 
#Region "升级支持"
	Private Shared m_vb6FormDefInstance As Form1
	Private Shared m_InitializingDefInstance As Boolean
	Public Shared Property DefInstance() As Form1
		Get
			If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
				m_InitializingDefInstance = True
				m_vb6FormDefInstance = New Form1()
				m_InitializingDefInstance = False
			End If
			DefInstance = m_vb6FormDefInstance
		End Get
		Set
			m_vb6FormDefInstance = Value
		End Set
	End Property
#End Region 
	
	Dim joke As Boolean
	Dim filename(10) As String
	Dim i As Short
	Dim j As Short
	Dim k As Short
	Dim l As Short
	Dim switch_Renamed As Boolean
	
	Dim StartX As Object
	Dim StartY As Short
	Dim EndX As Object
	Dim EndY As Short
	
	Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
	Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Integer, ByVal hrgn As Integer, ByVal bRedraw As Boolean) As Integer
	Private Declare Function auxSetVolume Lib "winmm.dll" (ByVal uDeviceID As Integer, ByVal dwVolume As Integer) As Integer
	Private Declare Function waveOutGetVolume Lib "winmm.dll" (ByVal uDeviceID As Integer, ByRef lpdwVolume As Integer) As Integer
	Private Declare Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Integer, ByVal dwVolume As Integer) As Integer
	
	Private Sub about_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles about.Click
		Beep()
		If switch_Renamed Then
			add_Renamed.Visible = False
			Closeb.Visible = False
			Combo1.Visible = False
			dall.Visible = False
			Delete.Visible = False
			Dir1.Visible = False

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -