1.工具箱上點鼠標右鍵,出現菜單,選擇 "選擇項.",在出現的窗口選擇"COM組建"選項卡,
選擇Shockwave Flash Object,打上勾,點"確定"按鈕.
2.在工具箱中會出現shockwave Flash Object,拖到窗體上即可使用
01 using System;
02 using System.Collections.Generic;
03 using System.ComponentModel;
04 using System.Data;
05 using System.Drawing;
06 using System.Text;
07 using System.Windows.Forms;
08 using System.IO;
09
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 }
作者:叢林聽雨