I solved my issue by timer...
I have created a timer in the login form which intialize the notfiy then it calls the function every 10 secs and check in database....
public static System.Timers.Timer aTimer;
public int cntibx = 0;
then on login button clicked
private void button1_Click(object sender, EventArgs e)
{
aTimer = new System.Timers.Timer(3000);
aTimer.Elapsed += new ElapsedEventHandler(Testtimer);
aTimer.Interval = 10000;
aTimer.Enabled = true;
aTimer.Start();
}
then the Testtimer function for doing the stuff and show notifyicon
public void Testtimer(object source, ElapsedEventArgs e)
{
int cnt= CountProcc();
if (cnt > cntibx)
{
cntibx = cnt;
QN.ShowBalloonTip(0, "QN Archive ", "inbox : " + cntibx, System.Windows.Forms.ToolTipIcon.Info);
}
}
Regards....