1.工具箱上点鼠标右键,出现菜单,选择 "选择项.",在出现的窗口选择"COM组建"选项卡,
选择Shockwave Flash Object,打上勾,点"确定"按钮.
2.在工具箱中会出现shockwave Flash Object,拖到窗体上即可使用
代码为:
1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Text; 7 using System.Windows.Forms; 8 using System.IO; 9 10 namespace FlashDemo 11 { 12 public partial class Form1 : Form 13 { 14 public Form1() 15 { 16 InitializeComponent(); 17 } 18 19 private void Form1_Load(object sender, EventArgs e) 20 { 21 axShockwaveFlash1.Movie =Directory.GetCurrentDirectory()+ "/demo2.swf";//注意路径要使用完整路径 22 } 23 24 private void button1_Click(object sender, EventArgs e) 25 { 26 axShockwaveFlash1.StopPlay(); 27 } 28 29 private void button2_Click(object sender, EventArgs e) 30 { 31 axShockwaveFlash1.Play(); 32 } 33 } 34 }
效果如: