0

Hello,

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

openFileDialog1.ShowDialog();
            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();
                    fr6.openFileDialog1.OpenFile();

                }
            }

isnt this code is enough to apply.

4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by hirenpatel53
0

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..

0

You can set image from anywhere using the BackgroundImage property.

Here's an example:

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

Edited by farooqaaa: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.