Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Save user Defined Image for Form Back Ground

$
0
0

hi

I have a c#  windows form Project.

with combo box i give choose to user to change desktop background ,with this codes:

           switch (ComImage.SelectedIndex)

            {
                case (0):
                    { string path;
                    path = Application.StartupPath + "\\1.jpg";
                    this.BackgroundImage = Image.FromFile(path);
                    this.BackgroundImageLayout = ImageLayout.Stretch;
                    }
                    break;

                case (1):
                    {
                        string path;
                        path = Application.StartupPath + "\\2.jpg";
                        this.BackgroundImage = Image.FromFile(path);
                        this.BackgroundImageLayout = ImageLayout.Stretch;
                    }
                    break;

                case (2):
                    {
                        string path;
                        path = Application.StartupPath + "\\3.jpg";
                        this.BackgroundImage = Image.FromFile(path);
                        this.BackgroundImageLayout = ImageLayout.Stretch;
                    }
                    break;
            }

the problem is when user close form every thing Disapper.

How Can I Save User Changes?

Thanks A lot


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>