private void DownloadImage(string url, string savePath, string fileName) { ptbProduct.ImageLocation = url; DownloadImage d = new DownloadImage(); Thread thread = new Thread(() => d.Download(url, savePath, fileName)); thread.Start(); }