唔知有无用,先转
经实践由于用的是VS2010,正确路径是工具=》选择工具箱项=》“COM组件”选择“Windows Media Player”播放器
代码未试
==========================================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace VideoGoogle
{
//选择菜单中的“工具”--“自定义工具箱”,打开“自定义工具箱”窗口,在“COM 组件”中选择“Windows Media Player”播放器和
//“Shockwave Flash Object”flash播放器
public partial class Form1 : Form
{
private static string PathBase = System.AppDomain.CurrentDomain.BaseDirectory;//目录
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//this.axWindowsMediaPlayer1.uiMode = "none";//右键axWindowsMediaPlayer1--属性--常规--控件布局--选择模式--None
this.tbarVolume.Minimum = 0; //設定音量調整Bar最小值為最小音量值(0)
this.tbarVolume.Maximum = 100; //設定音量調整Bar最大值為最大音量值(100)
this.tbarVolume.Value = this.axWindowsMediaPlayer1.settings.volume;
}
//打开
private void button5_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
//设置为可以打开多个文件