Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7828049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:09:23+00:00 2026-06-02T10:09:23+00:00

My program needs to display a dialog box to the user, which prompts the

  • 0

My program needs to display a dialog box to the user, which prompts the user to select the save folder, and then displays a Yes-No buttons messageBox to ask the user to confirm that they wish to continue.

This is my code:

/* Wait until user has selected a save folder */
do { } while (sSaveFolder == null);

/* Cancel operation if user clicks on cancel when in folder selection window */
if (sSaveFolder == "<cancel>")
{
    worker.ReportProgress(0, "Operation Cancelled\r\n\r\n**********\r\n");
    return;
}

/* Check for confirmation */
if (MessageBox.Show("Please confirm whether or not to continue.", "Do you wish to continue?", MessageBoxButtons.YesNo) == DialogResult.No)
{
    worker.ReportProgress(0, "Operation Cancelled\r\n\r\n**********\r\n");
    return;
}

The problem I’m getting is that I can run this once, click No and the worker thread terminates. But, if I click on the button to run the worker thread again, I get the message box popping up at the same time as the save folder dialog box – which, for obvious reasons is problematic. So does anyone know why this might be happening and how to solve it?

I found a work around to my particular problem by moving the message box to before the save folder dialog box but, as this is a weird problem, I thought I’d ask about it crops up again in the future.

Thanks in advance 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T10:09:33+00:00Added an answer on June 2, 2026 at 10:09 am

    I cannot see anywhere in your code where the value of sSaveFolder would be reset.

    Since you are reusing the same object the previous value may still be set, so the do…while completes very quickly and therefore the messagebox is displayed.

    Resetting the value of sSaveFolder before you display the dialog should fix your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The program needs to take in a simple string from the user and display
My program needs to know when a user ejects cd disc. Is there some
I have a program which needs to invoke a process to perform an operation
I have a program which needs to hold approximately 3000 open file descriptors in
I'm working on an assignment where the program needs to calculate and display the
I am writing a program which needs communication between processes. my code: #lang racket
I'm writing a program to allow a user to select a csv file, with
I am making a program which needs to add the value of all numericUpDowns,
I'm writing a program that, among other things, needs to display a context menu
I am writing a java program that needs a file open dialog. The file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.