📄 exitornot.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Suoxiao
{
public partial class ExitOrNot : Form
{
public int flag = 0;
public ExitOrNot(int flag)
{
InitializeComponent();
this.flag = flag;
}
private void ExitOrNot_Load(object sender, EventArgs e)
{
this.radioButton1.Checked = false;
this.radioButton2.Checked = false;
}
private void btnYes_Click(object sender, EventArgs e)
{
if (this.radioButton1.Checked == true)//退出系统
flag = 1;
if (this.radioButton2.Checked == true)//最小化到系统托盘
{
flag = 2;
}
if (this.flag == 0)
{
MessageBox.Show("请选择处理方式");
return;
}
this.DialogResult = DialogResult.OK;
this.Hide();
}
private void btnNo_Click(object sender, EventArgs e)
{
this.flag = 0;
this.radioButton2.Checked = false;
this.radioButton1.Checked = false ;
this.DialogResult = DialogResult.Cancel ;
this.Hide ();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -