i have load a image in my picture box. Then after that i load another image in same picture box.when i try to delete previous image from my drive then it show a message that source of previous image is used by program.
how can i free source of previous image????

This is very similar to your other thread.
I'll assume that this is about windows forms not WPF.
The following code seems to do the trick.

private void LoadMapImage(string filepath)
        {
            if (!string.IsNullOrEmpty(filepath) &&
                System.IO.File.Exists(filepath))
            {
                if (Map.Image != null)
                    Map.Image.Dispose();
                Map.Image = Bitmap.FromFile(filepath);
            }
        }
Be a part of the DaniWeb community

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