protected override void WndProc(ref Message msg)
2{
3 const int WM_SYSCOMMAND = 0x0112;
4 const int SC_CLOSE = 0xF060;
5
6 if (msg.Msg == WM_SYSCOMMAND && ((int)msg.WParam == SC_CLOSE))
7 {
8 // 点击winform右上关闭按钮
9 // 此处加入一段代码(调用button的click事件)
10
11
12
13 return;
14 }
15 base.WndProc(ref msg);
-----------------------------------------------------------------
private void btn_mainExit_Click(object sender, EventArgs e)
{
xxxxxxxxxx 若干语句
Application.Exit();
}
-----------------------------------------------------------------
请问在上面程序的第九行,如何调用button的click事件???
我在第9行插入
btn_mainExit_Click(sender, e) 不对
不知道怎么写?