How to close form

后端 未结 8 2137
南旧
南旧 2021-02-18 23:54

Ok, so a Windows Forms class, WindowSettings, and the form has a \"Cancel\"-button. When the user clicks the button, the dialog DialogSettingsCancel will pop-up up and ask the u

8条回答
  •  我寻月下人不归
    2021-02-19 00:00

    There are different methods to open or close winform. Form.Close() is one method in closing a winform.

    When 'Form.Close()' execute , all resources created in that form are destroyed. Resources means control and all its child controls (labels , buttons) , forms etc.

    Some other methods to close winform

    1. Form.Hide()
    2. Application.Exit()

    Some methods to Open/Start a form

    1. Form.Show()
    2. Form.ShowDialog()
    3. Form.TopMost()

    All of them act differently , Explore them !

提交回复
热议问题