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 Demo_Flash { public partial class Form1 : Form { Timer timer1 = new Timer(); Timer timer2 = new Timer(); Timer timer3 = new Timer(); int i = 0; int j = 0; public Form1() { InitializeComponent(); i = 1; j = 1; timer1.Tick += new EventHandler(timer1_Tick); timer1.Interval = (1000) * 10; timer1.Enabled = true; timer1.Start(); timer2.Tick += new EventHandler(timer2_Tick); timer2.Interval = (1000) * 10; timer2.Enabled = false; timer3.Tick += new EventHandler(timer3_Tick); timer3.Interval = (1000) * 5; timer3.Enabled = true; timer3.Start(); } void timer1_Tick(object sender, EventArgs e) { pictureBox1.Visible = false; pictureBox1.Enabled = false; axShockwaveFlash1.Visible = true; axShockwaveFlash1.BringToFront(); if (i == 1) { string path = System.Environment.CurrentDirectory; path += @"\Top_1.swf"; axShockwaveFlash1.LoadMovie(0, path); axShockwaveFlash1.Play(); i++; } else if (i == 2) { string path = System.Environment.CurrentDirectory; path += @"\Top_2.swf"; axShockwaveFlash1.LoadMovie(0, path); axShockwaveFlash1.Play(); i--; } } void timer2_Tick(object sender, EventArgs e) { axShockwaveFlash1.Visible = false; pictureBox1.BringToFront(); pictureBox1.Visible = true; pictureBox1.Enabled = true; if (j == 1) { pictureBox1.Image = Image.FromFile("D:/Project Source/Experimented/Bulk Sms/ProjectSms/ProjectSms/bin/Debug/Advertisement1_1.jpg"); j++; } else if (j == 2) { pictureBox1.Image = Image.FromFile("D:/Project Source/Experimented/Bulk Sms/ProjectSms/ProjectSms/bin/Debug/Advertisement2_1.jpg"); j--; } } void timer3_Tick(object sender, EventArgs e) { timer3.Enabled = false; timer2.Enabled = true; timer2.Start(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)