【问题标题】:Generating form_Closing for c sharp in visual studio在 Visual Studio 中为 c sharp 生成 form_Closing
【发布时间】:2011-04-26 06:15:16
【问题描述】:

只需在设计视图中双击表单,我们就可以在 Visual Studio 中为 c sharp 生成 form_Load()。是否也有相同的程序来生成 form_Closing()?

【问题讨论】:

    标签: c# winforms visual-studio formclosing


    【解决方案1】:

    在您选择的对象的属性下(通常是右下角),您会看到一个闪电。单击它,您将看到该对象可用的所有事件。双击其中一个事件,瞧!

    【讨论】:

      【解决方案2】:

      转到表单属性F4,滚动到关闭事件,双击它或输入您想要的事件处理程序的名称。将为您生成事件处理程序。

      【讨论】:

        【解决方案3】:

        你可以在表单的构造函数中做同样的事情

        this.FormClosing += new FormClosingEventHandler(Form2_FormClosing);
        //after += two tabs and you have your event
        

        【讨论】:

          猜你喜欢
          • 2011-12-13
          • 2015-06-22
          • 2011-05-02
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2012-07-19
          • 1970-01-01
          相关资源
          最近更新 更多