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

  • SEARCH
  • Home
  • 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 8598131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:04:56+00:00 2026-06-12T01:04:56+00:00

There is a button like below : private void btnStartAdventure_Click(object sender, EventArgs e) {

  • 0

There is a button like below :

   private void btnStartAdventure_Click(object sender, EventArgs e)
    {
        if (backgroundWorker5.IsBusy)
        {
            btnStartAdventures.Enabled = false;
            lblStatusValueInAdventures.Text = "Canceling...";
            backgroundWorker5.CancelAsync();
        }
        else
        {
            txtLogInAdventures.Text = string.Empty;
            btnStartAdventures.Text = "Cancel";
            lblUsersDoneCountValueInAdventures.Text = "---";
            lblStatusValueInAdventures.Text = "Running...";


            backgroundWorker5.RunWorkerAsync();
        }
    }

i want to call btnStartAdventure_Click event again after backgroundWorker_RunWorkerCompleted job!
so there will be a loop that never ends.
i put:

Thread.Sleep(3600000);

at the end of backgroundWorker_RunWorkerCompleted().
now what code should i use for call btnStartAdventure_Click again?
is Timer good for my purpose or not?
how can i prevent hanging and crashes by doing that job?

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-12T01:04:57+00:00Added an answer on June 12, 2026 at 1:04 am

    To fire the btnStartAdventure_Click event handler programmatically, you can call

    // Call the Click event of btnStartAdventure.
    btnStartAdventure.PerformClick();
    

    Just put that code in the end of the backgroundWorker_RunWorkerCompleted event.

    See this article for more information.

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

Sidebar

Related Questions

Below is my coding: Form2 msgForm; private void button3_Click_1(object sender, EventArgs e) { bw.WorkerReportsProgress
Is there a standard way to implement a button like the one below in
Is there a reason to cache myId like below (let's say the object myId
I am trying to create a CSS theme switcher button like below. The top
I developed a java web application which contains Wallpapers, there is like button for
Along with the Like button, there is a Send button, whose functionality is similar
is there a library or something to get iPhone and iPad button images like
Is there a way to check weather a user actually clicked the like button
Is there any event associated with Install Components Screen? Something like Next button disabled
in MXML, there is a Button class which you can instantiate like so: <mx:Button

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.