http://www.mediafire.com/?sharekey=0d482638ea4b7c6ee3462c012be639112c5abae67716f914


download this solution and plz chek that when i close the last windows form it actualy didnt close.it still running on underground.coz in VS it didnt visible the "run" button.the "pouse and stop" buttons are still running.so plz tel me a way to stop running the program underground on my PC.thanx

happybirthday.rar

The problem is you still have open forms. Here is the new code for Form1.cs:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace happybirthday
{
  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
      this.notifyIcon1.ShowBalloonTip(10000);
      this.Hide();
    }

    private void ShowBirthdayForm()
    {
      using (Prasadie p = new Prasadie())
      {
        p.ShowDialog();
      }
      textBox1.Clear();
      textBox2.Clear();
      this.Show();
    }

    private void notifyIcon1_BalloonTipClosed(object sender, EventArgs e)
    {
      ShowBirthdayForm();
    }
    //New event
    private void notifyIcon1_BalloonTipClicked(object sender, EventArgs e)
    {
      ShowBirthdayForm();
    }
  }
}

And for the other form:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace happybirthday
{
    public partial class Prasadie : Form
    {
        public Prasadie()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
          this.Close();
        }
    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.