我正在开发桌面应用程序。
我为桌面应用程序中的通知托盘开发了代码。
这是我用于设计视图的代码。
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;
}
以及下面用于通知内容的代码。
notifyIcon1.Visible = true;
notifyIcon1.BalloonTipText = "Hello notification";
notifyIcon1.BalloonTipTitle = Dl.name;
notifyIcon1.ShowBalloonTip(4000);
我要在此通知上显示按钮,并且还希望处理按钮单击以外的操作。
桌面应用程序可以吗?