i want to display NotifyIcon after elapsed time is over instead of message box
here is my code :
1.this code is in my form window :
string message = "The " + targetGrid.Rows[i].Cells[2].Value + " batch is completed!";// dataGridrow contains "00:05:22" (time)
notify.notifyTimer(TimeSpan.Parse(rTime), message);
2.this is my notifyclass and notify is object of that class
class NotifyClass
{
string msg;
public void notifyTimer(TimeSpan rts, string message)
{
var aTimer = new System.Timers.Timer(rts.TotalMilliseconds);
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
aTimer.Enabled = true;
msg = message;
}
private void OnTimedEvent(Object source, System.Timers.ElapsedEventArgs e)
{
System.IO.Stream str = Properties.Resources.ios_notification;
System.Media.SoundPlayer player = new System.Media.SoundPlayer(str);
player.Play();
MessageBox.Show(msg); **// Here i want to display notifyIcon**
player.Stop();
}
}
so whow to do that please help me..