Best way to communicate between forms?

后端 未结 4 1712
礼貌的吻别
礼貌的吻别 2020-12-21 08:51

I almost never used (advanced, or at all) graphical interfaces, or one simple form with simple controls... but this time I\'ve got something a little more complex, and I don

4条回答
  •  独厮守ぢ
    2020-12-21 09:07

    You can use the built in Tag property of the form which is an "object" class.

    public Form1() { (ComplicatedDataStructure)Tag = new ComplicatedDataStracture(); } . . form1 = new Form1(); . . form2 = new Form2(); . . form2.Tag = form1.Tag;

    so form2.Tag is equals to "ComplicatedDataStracture" object;

提交回复
热议问题