void f_OnDoneEvent(FileDownload f) { f.UIThread(() => { f.Hide(); Controls.Remove(f); _FileDownloadControls.Remove(f); }); }
private void Form1_DragDrop(object sender, DragEventArgs e) { var f = new FileDownload((string[])e.Data.GetData(DataFormats.FileDrop), _Client); f.Anchor = AnchorStyles.Top | AnchorStyles.Right; f.Left = this.Size.Width - f.Size.Width - 25; f.Top = 5; f.OnDoneEvent += f_OnDoneEvent; f.Show(); Controls.Add(f); f.BringToFront(); viewPort1.SendToBack(); _FileDownloadControls.Add(f); }