Specifically, I'm experiencing crashing if I use the ShowDialog method in a secondary form. I'm working on adding file transfer functionalities to a really basic asynchronous chat program. What I'm trying to do is, when the user receives a file transfer request, a dialogue pops up asking whether to accept or deny the transfer. Upon clicking accept, I want the user to be able to browse to a folder where that file gets saved.

Here's my code.

This is in the main form, Form1 and runs when a request for file transfer is received.
Code:
        private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e)
        {
            Form2 fileTransferAlert = new Form2();
            string result = fileTransferAlert.ShowDialog().ToString();

            if (result == DialogResult.No.ToString())
            {
                sendStatus = "dec";
                fileTransferAlert.Close(); // close the connection setup form
            }
            else if (result == DialogResult.Yes.ToString())
            {
                sendStatus = "acc";
                backgroundWorker3.RunWorkerAsync();
                fileTransferAlert.Close();
            }
        }
This is the code for clicking Accept. It is in Form2, the file transfer request dialogue.
Code:
        private void acceptButton_Click(object sender, EventArgs e)
        {
            
            FolderBrowserDialog fd = new FolderBrowserDialog();
            fd.ShowDialog();
            if (fd.ShowDialog() == DialogResult.OK)
            {
                fileReceive.receivedPath = fd.SelectedPath;
            }
            
            this.DialogResult = System.Windows.Forms.DialogResult.Yes;
        }
When I click accept, the program simply hangs until I click around the form, and only then will windows tell me it's stopped working.



By the way, the sticky in all caps told me to tell you all that I'm using .NET version 4.0.