0

I am working on desktop application.

I developed code for notification tray in desktop application.

here is my code for design view..

partial class Form1
{
    private System.ComponentModel.IContainer components = null;

    protected override void Dispose(bool disposing)
    {
        if (disposing && (components != null))
        {
            components.Dispose();
        }
        base.Dispose(disposing);
    }

    private void InitializeComponent()
    {
        this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
        this.notifyIcon1.Text = "notifyIcon1";
        this.notifyIcon1.Visible = true;
        this.notifyIcon1.Click += new System.EventHandler(this.notifyIcon1_MouseDoubleClick);
        this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);
    }

    private System.Windows.Forms.NotifyIcon notifyIcon1;
}

And below code for notification content.

notifyIcon1.Visible = true;  
notifyIcon1.BalloonTipText = "Hello notification";
notifyIcon1.BalloonTipTitle = Dl.name;
notifyIcon1.ShowBalloonTip(4000);

I want to show button on this notification and also I want handle than button click.

Is it possible with desktop application?

LarsTech
  • 80,625
  • 14
  • 153
  • 225
Smi10
  • 105
  • 1
  • 11
  • Have you ***ever*** seen a button in the notification tray? Me either. Thinking about it, isn't the icon itself very much like a button? What's the difference? – spender Oct 09 '18 at 11:24
  • Hello spender , thank you for your replay. yes notification tray is itself button. Actually i want to add more than one button at notification tray that's why i asked question. If you have solution for this please tell me. - – Smi10 Oct 09 '18 at 11:40
  • The conventional way to deal with this is to have the icon spawn a menu "on-click" and to place your "buttons" (menu choices) in the menu. Otherwise, consider multiple icons (a bit of an abuse IMO). – spender Oct 09 '18 at 11:47
  • That is right. I have to spawn a menu "on-click" and to place your "buttons" (menu choices) in the menu. It would be very appreciate if you have any link or example in which i get this code After all, thank you for your suggestion. – Smi10 Oct 09 '18 at 12:00
  • Google NotifyIcon MSDN : https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.notifyicon?view=netframework-4.7.2 – Sorceri Oct 09 '18 at 16:16

0 Answers0