在窗体上拖放一个按钮,用以动态的载入Windows Media Player 窗口。载入时可以选择其显示模式(uiMode:string类型)
可见:http://msdn.microsoft.com/en-us/library/dd562469(VS.85).aspx
代码:
namespace TestPanel
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private AxWMPLib.AxWindowsMediaPlayer myplayer = new AxWMPLib.AxWindowsMediaPlayer();
private void btnload_Click(object sender, EventArgs e)
{
this.panel1.Controls.Add(myplayer); //动态添加
myplayer.uiMode = "None"; //选择模式
myplayer.Height = this.panel1.Height;
myplayer.Width = this.panel1.Width;
}
}
}
浙公网安备 33010602011771号