frmshown.cs
来自「Microsoft Mobile Development Handbook的代码」· CS 代码 · 共 36 行
CS
36 行
using System;
using System.Windows.Forms;
using System.Diagnostics;
using System.ComponentModel;
namespace CodeForChapter2
{
public partial class frmShown : Form
{
public frmShown()
{
InitializeComponent();
}
private void frmShown_Closing(object sender, CancelEventArgs e)
{
// when this form is closed
// via Ok or via Close method call
Debug.WriteLine("Closing");
}
private void frmShown_Deactivate(object sender, EventArgs e)
{
// when this form goes to the background
// (closed, smart minimised or otherwise)
Debug.WriteLine("Deactivate");
}
private void menuItem1_Click(object sender, EventArgs e)
{
// Same as clicking on OK button
// If form only has an X, this still closes the form as if it had an OK
this.Close();
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?