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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:55:17+00:00 2026-05-18T08:55:17+00:00

I have a silly question which prevents me to proceed with my project. My

  • 0

I have a silly question which prevents me to proceed with my project.
My project involves multi-threading(foreground threads), so i would like to have all my threads kept in a different .cs file than Form1.cs.

Is this a good call or i should write
all my methods in the Form.cs? All the examples found on the net have the methods in the same class.

The problem that I am facing is: how to update my controls in the Form1.
If i had put my methods in the Form class it would be easy, i would have used:

if(this.InvokeRequired)
this.Invoke((Action)(() => richTextBox.Text += (line + Environment.NewLine)));

but updating that control from another class it gives me a headache, knowing that i might miss something rather simple.

  • 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-18T08:55:17+00:00Added an answer on May 18, 2026 at 8:55 am

    i would like to have all my threads
    kept in a different .cs file than
    Form1.cs.

    This statement is somewhat inaccurate as threads simply have execution contexts, which can be code from your Form1.cs or any other class file. However, I always prefer to only have form logic/manipulation code in my forms. Any other code should be elsewhere. With that, your other classes should NOT know about your form – that produces unnecessary coupling.

    Use events or callbacks to invoke responses you want of your form. Your form should then contain the code that invokes your UI manipulation code to run on the main UI thread.

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

Sidebar

Related Questions

I have a question which may be somewhat silly because I'm pretty sure I
Very simple + silly question: Does clojure provide multi maps? I currently have something
I have a Flash/Flex object (Flashlight-VNC), which I would like to dynamically resize to
This may be a silly question but... Say I have a String like 4e59
I have a question which might look silly. Is there any specific reason behind
Ok, I have a very silly question to ask (which Im rather embaressed about
This is my first attempt to use boost::threads and I have a silly question.
This may seem like a silly question. I have images that are reused on
I have a silly question here. I define a class with many data members,
I've a somewhat silly question, if i have a series of processes that are

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.