Screen saver in windows application
screen saver or slide show in windows application in .net
Screen saver in windows application
Hello friends here is the code of screen saver in windows application of .Net .suppose your project name is demo then put some .jpg images inside this path D:\demo\bin\debug\ .give the name of images like 1.jpg,2.jpg,3.jpg etc and write down following code in which we initialize i =1; then drag and drop timer control from tool box .At timer control timer1_tick event write down below code .on timer tick event your application automatically taking images from path(D:\demo\bin\debug\1.jpg ) set timer enable property to true .
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
Private int i;
public Form1()
{
InitializeComponent();
i=1;
}
private void timer1_Tick(object sender, EventArgs e)
{
this.BackgroundImage = Image.FromFile(Application.StartupPath + "\\" + i + ".jpg");
i++;
if (i > 4)
i = 1;
}
}
}