C#怎样点击窗体的关闭时让窗体隐藏,不是关闭 C#怎样点击窗体的关闭时让窗体隐藏,显示在系统托盘里? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 处理窗体的Closing事件在事件中添加e.Cancel = true;this.Hide(); private void FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing) { //User clicks the close button e.Cancel = true; Hide(); }else { //you can do whatever you like //for example Exit(); } } this.ShowInTaskbar = false; //不显示在系统任务栏 this.notifyIconMain.Visible = true; //托盘图标可见 补充 this.WindowState = FormWindowState.Minimized; //窗体最小化 this.hide.或者 this.空间名.visible=false; private void frmMain_Closing(object sender, System.ComponentModel.CancelEventArgs e) { this.notifySys.Visible=true; this.Hide(); e.Cancel = true; } this.hide();orthis.Visible=false this.hide(); 没有关闭啊。只是你看不见而已 C#如果让用户点击页面中指定的链接? c# 控制软件连接数 C#平台调用中的数据传送问题 求.net超专业后台做CRM用的 如何在windows服务的安装程序中实现服务的自动安装和服务,请高手指点?? textbox获取当前输入的值 SerialPort类如何判断串口写下位机无数据? 视频监控入门难题,有做过视频监控的赶紧帮我啊 请问关于用C#打开excel问题 寻C#Primer中文电子版下载 DataGridView和DataGridViewComboBoxColumn 如何让listbox中内容一个一个的按顺序赋到一个数组中去啊?请教大家
在事件中添加
e.Cancel = true;
this.Hide();
{
if (e.CloseReason == CloseReason.UserClosing)
{
//User clicks the close button
e.Cancel = true;
Hide();
}else
{
//you can do whatever you like
//for example Exit();
} }
this.notifyIconMain.Visible = true; //托盘图标可见
this.WindowState = FormWindowState.Minimized; //窗体最小化
或者 this.空间名.visible=false;
{
this.notifySys.Visible=true;
this.Hide();
e.Cancel = true;
}
or
this.Visible=false
没有关闭啊。只是你看不见而已