i have used this code:
private void bgworker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
Close();
}
and in form closing:
private void Form_FormClosing(object sender, FormClosingEventArgs e)
{
TopMost = false;
do { ++Top; Application.DoEvents(); Thread.Sleep(5); }
while (Top != r.Bottom);
}
i have this error: "A callback was made on a garbage collected delegate of type 'System.Windows.Forms!System.Windows.Forms.NativeMethods+WndProc::Invoke'. This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called."