使用效果:
代码:
#region 消息框变量
private Timer fadeTimer; // 定义计时器
private int fadeSpeed = 2;//淡出速度
private NotifyIcon notifyIcon;//气泡通知
private int opacityLevel = 10;//不透明度
public enum NotificationType
{
Error,//错误
Warning,//警告
Info//提示
}
#endregion
#region 消息提醒
public void NMessage(string message, NotificationType Type)
{
fadeTimer = new Timer();
fadeTimer.Tick += FadeTimer_Tick;
notifyIcon = new NotifyIcon();
notifyIcon.Visible = true;
// 根据类型选择合适的图标和错误类型
switch (T