Open Form2 from Form1, close Form1 from Form2

后端 未结 8 688
陌清茗
陌清茗 2020-12-03 13:06

Now, I have two forms, called form1 and form2, in the form1 there\'s a button, when I click it, then open the form2

Question: in the form2, I want to create a button

8条回答
  •  北海茫月
    2020-12-03 13:35

    Your question is vague but you could use ShowDialog to display form 2. Then when you close form 2, pass a DialogResult object back to let the user know how the form was closed - if the user clicked the button, then close form 1 as well.

提交回复
热议问题