2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by sknake
0

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();
        }
    }
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.