sp; menuItem2_Click(object sender, System.EventArgs e)
{
timer1.Stop();//停止计时器
}
private void menuItem3_Click(object sender, System.EventArgs e)
{
Application.Exit();//退出应用
程序 }
private void m_trayIcon_Click(object sender, System.EventArgs e)
{
if(m_bShowWnd == true)//隐藏主界面
{
this.Visible = false;
m_bShowWnd = false;
}
else//显示主界面
{
this.Visible = true;
m_bShowWnd = true;
}
}
最后还要添加timer1的Tick()函数:
private void timer1_Tick(object sender, System.EventArgs e)
{
if ( m_Icon1 != null && m_Icon2 != null ) //如果两个图标文件都被正确载入
{
//只要timer1被启动,则在两个图标之间不断进行选择变换,实现动画效果
if ( m_bFlag == true )
{
m_trayIcon.Icon = m_Icon2;
m_bFlag = false;
}
else
{
m_trayIcon.Icon = m_Icon1;
m_bFlag = true;
}
}
}
好了,按Ctrl+F5试试效果吧!
&nbs