hi,
i have a WELCOME screen. here i have a PICTURE BOX. there are 8 pictures
that go into this Picture Box.
At every 5 seconds i want to RANDOMLY load a new Picture.
this is what i am using but it is not loading the new picture.
Can any one help?
public void Presentation_Load(object sender, System.EventArgs e)
{
Timer timer1= new Timer();
timer1.Interval = 5000;
timer1.Enabled = true;
timer1.Tick += new System.EventHandler (OnTimerEvent);
}
public static void OnTimerEvent(object source, EventArgs e)
{
// 8 pictures
Random objRandom= new Random();
int num= objRandom.Next(1,8);
Presentation obj= new Presentation(); /// presentation is the name of
the class
if(num.ToString()=="1")
{
obj.DisplayCRMInfo(); ///// this function is as below
obj.Refresh();
return;
}
////// 7 more ifs follow
}
public void DisplayCRMInfo()
{
string picture = Application.StartupPath +@"\Presentation\CRM.jpg";
pictureBox1.Image = Image.FromFile(picture);
}