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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:10:38+00:00 2026-05-12T09:10:38+00:00

In a Windows Forms application I want to separate the GUI from the logic.

  • 0

In a Windows Forms application I want to separate the GUI from the logic. The user requests are complex and involve communications so I don’t want it to depend on the GUI thread. The structure should be something like:

        GUI -----> splash screen ---------> User Form --------------> ...
              |                        #
              | create Manager thread  | Show this Form
              #                        |
    Manager -----> Check user type -------> Wait for user command --> ...

Which are your advices, guidelines or patterns for a design like this one? Is it the correct choice? Thank you!

EDIT
The Manager thread should control the GUI and not in reverse. Moreover, the Manager thread should live during all the application time.

  • 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-12T09:10:38+00:00Added an answer on May 12, 2026 at 9:10 am

    Traditionally work like this is done using a BackgroundWorker

    Basically it is a simple class that gives you the ability to perform a function on a worker thread and then will automatically invoke back to the UI thread after that function is complete. During the time that the function is being run the UI is unblocked and can display a progress message, or process other user input (cancel for example).

    The result is similar to your pattern, but a separate thread is created and destroyed (well, there is pooling really…) for each task.

    UI thread ---> Show splashscreen------------------->Show window-------
                          |                           |return to UI      |
                          | create background worker  |                  |
                          -> Process user ------------                   ->Perform query etc.
    

    Okay, based on your comment:

    You can use a pattern like that, it is a simple case of eventing. Give the UI access to your manager so that it can perform a method call on it and register for events when the task is completed (this link shows the two major patterns for async operations in .NET). Inside the manager you’ll need to maintain a list of tasks that can be performed in sequence on the single thread and ensure that the events that are called to return the results to the UI are properly invoked so that are run on the main UI thread (basically recreate the background worker pattern).

    I’m not sure what you are hoping to gain by doing this, is there a reason the application needs to be limited to two threads? Are you concerned about the cost of creating backgroundworkers? Do you need some kind of query queue system? The examples in the diagram in your question don’t seem to require the complexity of this kind of pattern.

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

Sidebar

Related Questions

I am working on a Windows Forms application in VS 2008, and I want
Our Windows Forms application by default saves data files in a user's 'My Documents'
I'm starting a Windows Forms application from the command promt and I need to
I'm developing an Windows Forms application that requires me to call a separate program
In a C# windows forms application. I have a splash screen with some multi-threaded
I'm writing a Windows Forms application which is supposed to play three sound files
I'm writing a Windows Forms Application in C#.NET On startup, the application displays a
I've got a Windows Forms application with two ListBox controls on the same form.
This is a Windows Forms application. I have a function which captures some mouse
I have a Windows Forms application that I wrote that does some monitoring of

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.