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 7491381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:02:41+00:00 2026-05-29T16:02:41+00:00

I have the code below (but doesn’t work) .. i need to wait till

  • 0

I have the code below (but doesn’t work) .. i need to wait till the thread complete its job then execute then next command

private void btnPaste_Click(object sender, EventArgs e)
    {
        if (copiedItems != null)
        {
            if (copy)
            {
                System.Threading.Thread thPASTE = new System.Threading.Thread(PasteFromCopy);
                thPASTE.Start(currAddress);
                lock (this)
                {
                    btnRefresh_Click(sender, e);
                }
            }
            else
            {
                System.Threading.Thread thPASTE = new System.Threading.Thread(PasteFromMove);
                thPASTE.Start(currAddress);
                lock (this)
                {
                    btnRefresh_Click(sender, e);
                }
            }
        }
    }

the paste should do some code then after that i should refresh the list im showing.. i need to do it this way, because it doesn’t work for me when i call the refresh in the thread
how do i do it ??

  • 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-05-29T16:02:42+00:00Added an answer on May 29, 2026 at 4:02 pm

    You could use the Join method on the thread instance which will block the calling thread until the other thread has finished.

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

Sidebar

Related Questions

I have below code in my Form Load event handler but the ListView doesn't
I have written the code below for a login page, but doesn't seem to
I have to code below - works great in IE and Opera, but does
I want to open an xlsx file, I have tried the below code,but neither
I have tried rectifying the code below. But I am not able to find
I have a segmentation fault in the code below, but after I changed it
I have this code below which works fine but seems unnecessary as it loops
Hi I have written such a code below but it returns wrong output which
I have a simple click function with the code below, but I can't seem
This code below compiles fine with VS2010 but doesn't want to compile with gcc

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.