I am having a form for that i want to change the background for every 10 seconds?

Posted by Sudheep.grandhe under C# on 11/4/2011 | Points: 10 | Views : 826 | Status : [Member] | Replies : 3
Hi,

I am developing windows applications.I am having a form for that i want to change the background of a form for every 10 seconds?can you please send the sample code.please do the needful.

Best,
Sudheep.



Responses

Posted by: Blessyjees on: 11/4/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,

Using timer you can do this. Write the the code for cahnge the background in the event timer_Elapsed

private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)

{
Form1.ActiveForm.BackColor = Color.AliceBlue;
}


Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sudheep.grandhe on: 11/4/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

i am asking form background image.

Best,
Sudheep.

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Blessyjees on: 11/4/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,
try this

 private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)

{
this.BackgroundImage = new Bitmap(@"D:\VS2010\PhotoFrame\Images\small\tiny2.jpg");
}


You should specify the full path of the image.

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response