Hide form instead of closing when close button clicked

前端 未结 7 1761
南旧
南旧 2020-11-28 08:47

When a user clicks the X button on a form, how can I hide it instead of closing it?

I have tried this.hide() in FormClosing but

相关标签:
7条回答
  • 2020-11-28 09:14

    From MSDN:

    To cancel the closure of a form, set the Cancel property of the FormClosingEventArgs passed to your event handler to true.

    So cancel then hide.

    0 讨论(0)
提交回复
热议问题