I have a query that. I have a splash form that is my first form of the project and I want to change the background image of that form after that is closed. For example my software starts and after splash form and in setting I have a function to change the background image of the splash form. Can I change the background image when the form is closed? (as my splash form is closed when user enters the setting form).
I have written this code form changing the background image but I don't know how to change the form image when the splash form opens it should open changing the image from the open file dialog.
My code is:
var FD = new System.Windows.Forms.OpenFileDialog();
FD.Filter = "jpeg files|*.jpg";
if (FD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string fileToOpen = FD.FileName;
System.IO.FileInfo File = new System.IO.FileInfo(FD.FileName);
BackgroundImage = Image.FromFile(FD.FileName);
}
Ok try the below
you already set a background image for your splash screen
eg : it location was c:\sam.jpeg
Now try the below code on form close event
System.IO.File.Delete(@"C:\Sam.jpeg");
Image.FromFile(FD.FileName).Save(@"C:\Sam.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
now it delete the old file and set the new image on old name...
at the time of reload it shows the new background image...