private void WhileStarted() { while (true) { Thread.Sleep(100); if (StaticPublicClass.FullSizeBool) { StaticPublicClass.FullSizeBool = false; imagefullsize = new ImageFullSize(); IMAGEFULLSIZEDELEGATE = new ImageFullSizeDelegate(AddControllInForm); imagefullsize.WH("http://193.107.239.115/original/" + StaticPublicClass.FullSizeName); imagefullsize.Location = new Point(230, 50); imagefullsize.Size = new Size(500, 500); //Controls.Add(imagefullsize); //imagefullsize.BringToFront(); Invoke(IMAGEFULLSIZEDELEGATE, imagefullsize); } } }
private void AddControllInForm(ImageFullSize str) { Controls.Add(imagefullsize); imagefullsize.BringToFront(); }