You shouldn't be showing a form from a non-UI thread. You should only have one UI thread, and it, and only it, should access all of your user interface controls. Your non-UI threads shouldn't access UI elements at all.
You should be showing the given busy popup from the UI thread instead.
Requesting cancellation from the BackgroundWorker
, or disposing of it, won't close the form, or force the thread to stop executing, which is why your form stays open.
Instead just show your popup from the UI thread when you start the background worker, and have the BGW's completed event call Close
on the form:
private void button1_Click(object sender, EventArgs args)
{
BusyForm busyForm = new BusyForm();
BackgroundWorker worker = new BackgroundWorker();
worker.DoWork += worker_DoWork;
worker.RunWorkerCompleted += (_, e) => { busyForm.Close(); };
worker.RunWorkerAsync();
busyForm.ShowDialog();
}