需要添加一个toolTip和notifyIcon,然后设置属性:isBalloon属性为True,之后添加相应的按钮点击事件
private void clewButton_Click(object sender,EventArgs e)
{
this.notifyIcon1.Visible = true;
this.notifyIcon1.ShowBalloonTip(1000,"当前时间:",DateTime.Now.ToLocalTime().ToString(),ToolTipIcon.Info);
}
private void closeButton_Click(object sender,EventArgs e)
{
this.notifyIcon1.Visible = false;
}
private void notifyIcon1_MouseMove(object sender,MouseEventArgs e)
{
this.notifyIcon1.ShowBalloonTip(1000,"当前时间:",DateTime.Now.ToLocalTime().ToString(),ToolTipIcon.Info);
}