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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:35:30+00:00 2026-05-16T02:35:30+00:00

I have 2 forms ParentForm and a child form. In my parent form I

  • 0

I have 2 forms ParentForm and a child form. In my parent form I have a thread listener which listens to a feed which updates an area of the ParentForm. Now, I have a ChildForm which also needs the data from the listener to be placed on an area of the ChildForm. the thread listener uses delegate to update my ParentForm when it gets a feed.

My ParentForm has these.

private delegate void UpdateLogCallback(string strFeed);
private Thread thr;

private void InitializeFeed()
{
    ...
    // Get the feed connection
    ...
    thr = new Thread(new ThreadStart(ReceivedFeeds));
    thr.Start();
}

private void ReceivedFeeds()
{
    string strFeed = GetFromStream();
    
    // invoke my updater while connected
    while(Connected)
    {
        this.Invoke(new UpdateLogCallback(this.UpdateLog), new object[] { strFeed });
    }
}

private void UpdateLog(string strFeed)
{
    txtLog.AppendText(strFeed + "\r\n");
}

this works fine, now here’s the question. When I open a ChildForm from the ParentForm, I also want to update a centain part of that form using what I get from the ReceivedFeeds() in my ParentForm how will I achieve this? I can’t create another feed connection in the ChildForm since this will duplicate the Connection and cause an error. I just want to do the same as what UpdateLog() will do in the ChildForm.

Edit

I’m calling the ChildForm to open on an OnClick event on the parent form and show it.

// onclick event
ChildForm childForm = new ChildForm();
childForm.Name = ((ListBox)sender).SelectedItem.ToString();
childForm.ShowDialog(this);

This is how I open my ChildForm and how do I call the methods inside the ChildForm in my UpdateLogCallback or in my UpdateLog()

I also have an UpdateLog() method in my ChildForm.

  • 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-16T02:35:30+00:00Added an answer on May 16, 2026 at 2:35 am

    If you simply hold a reference to the child form from within your parnet form you can call the UpdateLog method from the parent form

    private void UpdateLog(string strFeed)
    {
        txtLog.AppendText(strFeed + "\r\n");
        _child.UpdateLog(strFeed);
    }
    

    EDIT:

    Also, if you have many child forms you can have a collection of them. Just make sure you remove them from the list when they close.

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

Sidebar

Related Questions

Please guide and help me. I have a MDI parent form which has a
hi i have childform and parent form I want to show picture in picturebox
I have an mdi child form as a dockable content in my application and
I two forms, Form1, and a UserControl which hosts Form2. Within that UserControl on
I have http://parent.com that opens a pop-up on http://parent.com:8888 (this is in development, in
Hi how can I change text value of text box in parent window from
I have an assignment to enhance an already existing tool written in Borland c++,
I've got a question regarding sub forms. Currently I've got 2 sub forms and
We are developing an MDI Application. What we need to do is that I
Basically I am having two problems with C#.NET MDI. You can download VS2010 solution

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.