当按下关闭窗体时的问题
当按下关闭窗体时,能使和序能远行,而且在任务栏上显示图标,窗体隐藏,该怎么做呢?private void seaPlayer_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
DialogResult=MessageBox.Show("是否要把放到状态栏上","",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
if(DialogResult==DialogResult.Yes)
{
seaPlayer sp=new seaPlayer(); //窗体类
sp.Hide();
this.notifyIcon1.Visible = true;
e.Cancel = true;
}
}
可我上面的代码不能把窗体给隐葳,怎能么改 --------------------编程问答-------------------- private void seaPlayer_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
DialogResult=MessageBox.Show("是否要把放到状态栏上","播放器",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
if(DialogResult==DialogResult.Yes)
{
this.WindowState = FormWindowState.Minimized;
this.Visible=false;
this.notifyIcon1.Visible = true;
e.Cancel = true;
}
} --------------------编程问答-------------------- private void seaPlayer_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
DialogResult=MessageBox.Show( "是否要把放到状态栏上 ", "播放器 ",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
if(DialogResult==DialogResult.Yes)
{
this.WindowState = FormWindowState.Minimized;
this.Hide();
this.notifyIcon1.Visible = true;
e.Cancel = true;
}
} --------------------编程问答--------------------
补充:.NET技术 , ASP.NET