i am a student studying c# and working on wnform. i have a winform which have a splash form which loads its background image from the resources folder. and after the splash screen and in the main software there is a setting from which i have a button so that the splash screen can be changed with the help of open file dialog. so i want that it should replace the image splashimage.jpg in the resource folder with the image the user selected. i want to copy the image the use selected to the resource folder and remove the previous image and rename the image of the newly copied image to the splashimage.jpg i have this code but it does not work the image in the resource folder is not changing with the image which i have selected in the open file dialog i dont know why it is not working
var FD = new System.Windows.Forms.OpenFileDialog();
FD.Filter = "jpeg files|*.jpg";
if (FD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ "\\" + splashimage.jpg", true);
Edited 23-Jan-13 5:32am
The possible reason could be the 'splashimage.jpg' loaded by the splash form is in use and hence you cannot replace it.
Check your splash form which loads the splashimage is disposed before you perform the copy operation. or atleast dispose the image file you loaded to the splash form.
Edited 23-Jan-13 13:03pm
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)