Communication between form can be done in many ways usi开发者_开发知识库ng constructor using delegates etc in .net but my question is how can i access a value that is entered into a child form from a parent form or can a two way communication is possible between windows forms.
Provide the values of the child form as properties that can be accessed from the parent form.
E.g.
using ( var form = new ChildForm() )
{
    form.SomeValue = "abc";
    if ( form.ShowDialog(this) == DialogResult.OK )
    {
        var x = form.SomeValue;
    }
}
Use this block in your parent form to pass values to and from the child form.
In the child form, the SomeValue property can map to e.g. a TextBox:
public string SomeValue
{
    get { return MyTextBox.Text.Trim(); }
    set { MyTextBox.Text = value; }
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论