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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:45:27+00:00 2026-05-26T02:45:27+00:00

I am stuck in a deep problem right now. Plz help me with this….

  • 0

I am stuck in a deep problem right now. Plz help me with this….

I created a FORM call it form1. It contains a textbox T1. I started it running…
inside form1 there is a thread running which does some process P which is a member of a different CLASS call it class2.
To run the process P, I need a value from textbox T1. HOW DO I DO THAT?

Let me tell you, what I tried already.
I created instance of form1 in class2, and then tried to read textbox (T1) value. But that was empty, I figured out that reason…. rest, I tried with the property… Again failed…

PLZ help me with this. I am stuck since hours….

  • 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-26T02:45:28+00:00Added an answer on May 26, 2026 at 2:45 am
        Assuming Class1 is the class which does some process in thread. Create the property which corresponds to type of your main form. In this case, its called Form1. 
    
    
    
         class Class1
            {
        //his is the property
                public Form1 MyMainForm { get; set; }
    
                public  void    ShowText()
                {
    
    //here the control is accesses 
    //((TextBox)MyMainForm.Controls.Find("textBox1",true)[0])
                    MessageBox.Show(((TextBox)MyMainForm.Controls.Find("textBox1",true)[0]).Text);
                }
            }
    
        im assuming ShowText() method is called on new thread, when button is clicked.
    
         private void button1_Click(object sender, EventArgs e)
                {
        //craete instance of class1
                    Class1 c = new Class1();
        //set the  property            
        c.MyMainForm = this;
        //start the method is new thread
                    ThreadStart ts=new ThreadStart(c.ShowText);
                    Thread t=new Thread(ts);
                    t.Start();
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I get exceptions, it is often from deep within the call stack. When
I'm a bit stuck on this. Basically I want to do something like the
In my rails project I have a form to enter a dollar amount. This
NOTE: This is actually a database of a forum. I am stuck in an
I'm reading Chris Pine's book Learn to Progam (it's about Ruby). Right now I'm
The following function generates a 'stack level too deep (SystemStackError)' for n = 5,000
Being stuck with a legacy database schema that no longer reflects your data model
Really stuck on trying to write code to unzip a file or directory on
Kinda stuck here... I have an application with lets say 5000 rows of data
Disclaimer: I'm stuck on TFS and I hate it. My source control structure looks

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.