Pass value from parent form to child form?

后端 未结 3 684
梦如初夏
梦如初夏 2021-01-27 18:36

I\'m trying to pass a value set in my parent form to a second form. I created a property with a get part in the parent form.

I don\'t want to do something like:

3条回答
  •  忘了有多久
    2021-01-27 18:56

    See this example.

    1-Create a window form application,Declare a public string global variable in Form1 , using this variable we can pass value from Form1 to Form2.

    2-Now in form2 ,Create a object for Form1 and Get the value using this object.

    See image

提交回复
热议问题