?? form1.cs
字號(hào):
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace mediaplay
{
/// <summary>
/// Form1 的摘要說明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash1;
private AxWMPLib.AxWindowsMediaPlayer axWindowsMediaPlayer1;
/// <summary>
/// 必需的設(shè)計(jì)器變量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows 窗體設(shè)計(jì)器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 調(diào)用后添加任何構(gòu)造函數(shù)代碼
//
axShockwaveFlash1.Movie=Application.StartupPath+"\\videoControlButtons.swf";
//axWindowsMediaPlayer1.URL=Application.StartupPath+"\\movie.avi";
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗體設(shè)計(jì)器生成的代碼
/// <summary>
/// 設(shè)計(jì)器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內(nèi)容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash();
this.axWindowsMediaPlayer1 = new AxWMPLib.AxWindowsMediaPlayer();
((System.ComponentModel.ISupportInitialize)(this.axShockwaveFlash1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).BeginInit();
this.SuspendLayout();
//
// axShockwaveFlash1
//
this.axShockwaveFlash1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.axShockwaveFlash1.Enabled = true;
this.axShockwaveFlash1.Location = new System.Drawing.Point(0, 24);
this.axShockwaveFlash1.Name = "axShockwaveFlash1";
this.axShockwaveFlash1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axShockwaveFlash1.OcxState")));
this.axShockwaveFlash1.Size = new System.Drawing.Size(320, 248);
this.axShockwaveFlash1.TabIndex = 1;
this.axShockwaveFlash1.FSCommand += new AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEventHandler(this.axShockwaveFlash1_FSCommand);
//
// axWindowsMediaPlayer1
//
this.axWindowsMediaPlayer1.Enabled = true;
this.axWindowsMediaPlayer1.Location = new System.Drawing.Point(48, 272);
this.axWindowsMediaPlayer1.Name = "axWindowsMediaPlayer1";
this.axWindowsMediaPlayer1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axWindowsMediaPlayer1.OcxState")));
this.axWindowsMediaPlayer1.Size = new System.Drawing.Size(208, 32);
this.axWindowsMediaPlayer1.TabIndex = 2;
//this.axWindowsMediaPlayer1.Controls+=new AxWMPLib._WMPOCXEvents_CurrentMediaItemAvailableEventHandler (this.)
// 需要繼續(xù)編輯,我想用media控制flash
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(320, 398);
this.Controls.Add(this.axWindowsMediaPlayer1);
this.Controls.Add(this.axShockwaveFlash1);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.axShockwaveFlash1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 應(yīng)用程序的主入口點(diǎn)。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void axShockwaveFlash1_FSCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e)
{
switch(e.command)
{
case "pause":
{
axWindowsMediaPlayer1.Ctlcontrols.pause();
}
break;
case "play":axWindowsMediaPlayer1.Ctlcontrols.play();
break;
case "fullscr":axWindowsMediaPlayer1.fullScreen=true;
break;
case "close":Application.Exit();
break;
default:
break;
}
}
// private void axWindowsMediaPlayer1_Enter(object sender, System.EventArgs e)
// {
// }
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -