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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:57:21+00:00 2026-05-23T12:57:21+00:00

I am running this code in a seperate thread on my C# Winforms app

  • 0

I am running this code in a seperate thread on my C# Winforms app (the name of my form is MainForm):

DisplayDownload form2 = new DisplayDownload();

form2.TopMost = true;  
form2.Show();

But when the thread is launched, the form never opens. If I move the code onto the main thread of my app, it opens fine, but if I launch it as it’s own thread, the form never opens.

I tried using the accepted answer from this post: Calling a windows form from another thread (.Net) but I get this error:

Cannot convert anonymous method to type ‘System.Delegate’ because it is not a delegate type

Here is the code I am trying to utilize:

MainForm.Invoke(delegate {
         DisplayDownload form2 = new DisplayDownload();


         form2.TopMost = true; 
         form2.Show();
});

Can someone please tell me what I am doing wrong and how to get it to work?

  • 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-23T12:57:22+00:00Added an answer on May 23, 2026 at 12:57 pm

    Add new MethodInvoker(delegate(), So:

    MainForm.Invoke(new MethodInvoker(delegate() 
    {
                 DisplayDownload form2 = new DisplayDownload();
    
    
                 form2.TopMost = true; 
                 form2.Show();
    }));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say we have some code like this running in the separate thread: private
Running FxCop on my code, I get this warning: Microsoft.Maintainability : 'FooBar.ctor is coupled
Similar to this question , after running the following code the browser dialog does
Following the directions at this question , I have some code running to extract
I've got a bunch of servers running this Linux app. I'd like for them
I'm in javascript, running this in the console d = new Date(); d.setMonth(1); d.setFullYear(2009);
Been running into this problem lately... When debugging an app in VS.Net 2005, breakpoints
This is a puzzler. Relevant Environment: Flex app, running parsley, which gets built by
We have code running JNI in a separate thread. We occasionally get segmentation faults
I am using ReSharper with C#/VS2010. I am running a seperate thread that needs

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.