Try the NotifyIcon.ShowBalloonTip method:
Displays the tip of the ball with the specified title, text, and icon on the taskbar for a specified period of time.
void Form1_DoubleClick(object sender, EventArgs e) { notifyIcon1.Visible = true; notifyIcon1.ShowBalloonTip(20000, "Information", "This is the text", ToolTipIcon.Info ); }
If you want to change the tray icon, create the ondemand icon and set it to NotifyIcon.Icon :
you can use these codes to create the icon (Updated):
public static Icon GetIcon(string text) { Bitmap bitmap = new Bitmap(32, 32); Icon icon = SmsSender.Properties.Resources.notifficationicon; System.Drawing.Font drawFont = new System.Drawing.Font("Calibri", 16, FontStyle.Bold); System.Drawing.SolidBrush drawBrush = new System.Drawing.SolidBrush(System.Drawing.Color.White); System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap); graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixel; graphics.DrawIcon(icon, 0, 0); graphics.DrawString(text, drawFont, drawBrush, 1, 2); Icon createdIcon = Icon.FromHandle(bitmap.GetHicon()); drawFont.Dispose(); drawBrush.Dispose(); graphics.Dispose(); bitmap.Dispose(); return createdIcon; }
see the same project:
source share