实现效果:
知识运用:
NotifyIcon控件的ShowBalloonTip方法
用于在任务栏中持续显示具有制定标题 文本 和图标的气球提示
Void NotfyIcon.ShowBalloonTip(int timeout,string tipTitle,string tipText,ToolTipIcon tipIcon);
实现代码:
private void button1_Click(object sender, EventArgs e) { this.notifyIcon1.Visible = true; this.notifyIcon1.ShowBalloonTip(1000,"当前时间:",DateTime.Now.ToLocalTime().ToString(),ToolTipIcon.Info); } private void button2_Click(object sender, EventArgs e) { this.notifyIcon1.Visible = false; }