how to communicate data between forms?

后端 未结 4 752
后悔当初
后悔当初 2021-01-23 18:51

I want to pass some values to different forms at there button click event. plz guide me.I am using c sharp.net 2005,win forms. I want to access the value in a sql query in form

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-23 19:36

    You have several options:

    • pass the data to the constructor of the child form
    • expose a instance property in the parent form, then pass that form as an argument to the child form
    • expose a static property in the parent form

提交回复
热议问题