I want to set the background image of form as per user selection. for that i have take openFileDialog but it only show the wallpapers when i click on open button it not applied to form. it show an error message that "path not found"

this code is on menu strip option

            DialogResult dialog = MessageBox.Show("Do You Want To Apply This Wallpaper On Your Page","Add WallPaper" ,MessageBoxButtons.YesNo);
                if (dialog == DialogResult.Yes)
                    Form6 fr6 = new Form6();


isnt this code is enough to apply.

as per site u have given to me. It apply to form which are stored in the imeage list but I want to apply from difrent locations. Example : c drive, d drive where the user stored his images. I tried to make some changes on coding given by the site but it not apply to the form. if you know that which property i have to set to speacify the path yhen plaese tell me..

You can set image from anywhere using the BackgroundImage property.

Here's an example:

this.BackgroundImage = Image.FromFile(@"C:\images\wallpaper.jpg");

You can use BackgroundImage property of form

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.