Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
good morning. i used this code to change the background for the button , but it do nothing . and give me no error ,no exception . i don't know why .
"this.startpress.BackgroundImage = ((System.Drawing.Image)(Properties.Resources.stop_press1));" . thank you
Posted

I think your resourse stop_press1 is empty. You can try this:
C#
this.startpress.BackgroundImage = Image.FromFile("filename.jpg");

Hope this helps.
 
Share this answer
 
it give me no result . :(
C#
private void startpress_Click(object sender, EventArgs e)
       {
           this.startpress.BackgroundImage = Image.FromFile(@"C:\Users\aziza\Documents\Visual Studio 2010\Projects\PeerToPeerChat\PeerToPeerChat\Resources\start-press2.png");


       }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900