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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:42:27+00:00 2026-06-04T14:42:27+00:00

There is a child textbox control in an chlid window form created by main

  • 0

There is a child textbox control in an chlid window form created by main window form using thread technology, and I wanna implement this function: In the child window form, when I click a button (or Enter-key-down), it pass the text to the main window form. What can I do about that?

  • 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-06-04T14:42:28+00:00Added an answer on June 4, 2026 at 2:42 pm

    You need a way for the ChildWindow to send a message back to MainWindow. Following example should be useful:

    Code:

    An Interface to allow “communication” between windows

    public interface IListner
    {
        void Send(String message);
    }
    

    MainWindow

    public partial class MainWindow : Window, IListner
    {
        public MainWindow()
        {
            InitializeComponent();
        }
    
        public void Send(string message)
        {
            // Read the message here.
            // If this code is called from different thread, use "Dispatcher.Invoke()"
        }
    
        public void OpenAnotherWindow()
        {
            // Since "MainWindow" implements "IListner", it can pass it's own instance to "ChildWindow"
            ChildWindow childWindow = new ChildWindow(this);
        }  
    }
    

    ChildWindow:

    public partial class ChildWindow : Window
    {
        private IListner Listner { get; set; }
    
        public ChildWindow(IListner listner)
        {
            InitializeComponent();
    
            Listner = listner;
        }
    
        private void OnTextBoxTextChanged()
        {
            // This will call "Send" on "MainWindow"
            Listner.Send(TextBox1.Text);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project with a main MDI form. There is a child MDI
I had a main form. I created a child form that is instantiated by
I have created my own control which contains TextBox control as a child control.
Is there any way to differentiate the child processes created by different fork() functions
I have a scenario. (Windows Forms, C#, .NET) There is a main form which
What advantage is there to designing child-parent relationships, which allow us to do writes
If you have Parent has_many :children Child Is there any reason a foreign key
Is there any way that parent tag styles do not apply to child tag
Is there a way for a parent MenuItem to be notified when a child
Is there a way to update only the parent UpdatePanel without updating the child

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.