From 59a03c5660209acfac6cafae2a46c15f316b7f3e Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期五, 07 十一月 2025 14:35:28 +0800
Subject: [PATCH] 修改过站提示
---
DevApp/Gs.DevApp/UserControl/Toast.cs | 26 ++++++++------------------
1 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/DevApp/Gs.DevApp/UserControl/Toast.cs b/DevApp/Gs.DevApp/UserControl/Toast.cs
index 690d21b..7513510 100644
--- a/DevApp/Gs.DevApp/UserControl/Toast.cs
+++ b/DevApp/Gs.DevApp/UserControl/Toast.cs
@@ -10,7 +10,6 @@
private System.Windows.Forms.Timer tmr;
private System.Windows.Forms.Timer tmr2;
-
/// <summary>
///
/// </summary>
@@ -20,9 +19,10 @@
public Toast(int it, string messageText, int vanishingSeconds = 5)
{
InitializeComponent();
- this.testo.Appearance.BackColor = System.Drawing.Color.Firebrick;
- this.testo.Appearance.Font = new System.Drawing.Font("Tahoma", 38F);
- this.testo.Appearance.ForeColor = System.Drawing.Color.White;
+ messageText=messageText.Replace("@n", "\r\n");
+ this.lbMsg.BackColor = System.Drawing.Color.Firebrick;
+ this.lbMsg.Font = new System.Drawing.Font("Tahoma", 38F);
+ this.lbMsg.ForeColor = System.Drawing.Color.White;
try
{
string _vanishingSeconds = ConfigurationManager.AppSettings["ToastSeconds"];
@@ -36,14 +36,14 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Toast));
if (it > 0)
{
- this.testo.Appearance.BackColor = System.Drawing.Color.SeaGreen;
+ this.lbMsg.BackColor = System.Drawing.Color.SeaGreen;
}
else
{
- this.testo.Appearance.BackColor = System.Drawing.Color.Firebrick;
+ this.lbMsg.BackColor = System.Drawing.Color.Firebrick;
}
double elapsedTime = 0;
- testo.Text = messageText;
+ lbMsg.Text = messageText;
double vanishingMilliSeconds = vanishingSeconds * 1000;
tmr = new System.Windows.Forms.Timer();
tmr.Tick += delegate
@@ -70,16 +70,6 @@
tmr2.Interval = (int)TimeSpan.FromMilliseconds(50).TotalMilliseconds;
tmr2.Start();
}
-
- private void VanishingMessage_Paint(object sender, PaintEventArgs e)
- {
- Graphics g = this.CreateGraphics();
- Pen p = new Pen(Color.DarkRed);
- SolidBrush sb = new SolidBrush(Color.DarkRed);
- Rectangle r = this.DisplayRectangle;
- r.Width -= 1;
- r.Height -= 1;
- g.DrawRectangle(p, r);
- }
+
}
}
\ No newline at end of file
--
Gitblit v1.9.3