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.Designer.cs | 94 ++++--------------------------
DevApp/Gs.DevApp/App.config | 4
DevApp/Gs.DevApp/UserControl/Toast.cs | 26 ++------
DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs | 10 +-
4 files changed, 29 insertions(+), 105 deletions(-)
diff --git a/DevApp/Gs.DevApp/App.config b/DevApp/Gs.DevApp/App.config
index c31e074..8cf35bf 100644
--- a/DevApp/Gs.DevApp/App.config
+++ b/DevApp/Gs.DevApp/App.config
@@ -36,8 +36,8 @@
</runtime>
<appSettings>
- <add key="webapiurl" value="http://localhost:5263/" />
- <!--<add key="WebApiUrl" value="http://192.168.1.145:8081/" />-->
+ <!--<add key="webapiurl" value="http://localhost:5263/" />-->
+ <add key="WebApiUrl" value="http://192.168.1.145:8081/" />
<!--<add key="WebApiUrl" value="http://192.168.1.145:81/" />-->
<add key="LogPath" value="logs" />
<add key="ProductName" value="G-MES V2.0" />
diff --git a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs
index 17ccd66..f7a9f83 100644
--- a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs
@@ -140,7 +140,7 @@
{
if (txt_gongWei.Text.Trim().Length <= 0)
{
- Toast vm = new Toast(-1, "~璇锋壂宸ヤ綅鐮亊");
+ Toast vm = new Toast(-1, "鎿嶄綔澶辫触@n璇峰厛鎵弿宸ヤ綅鐮�");
vm.Show();
this.ActiveControl = this.txt_gongWei;
txt_gongWei.Focus();
@@ -161,7 +161,7 @@
int idx = tabMx.SelectedTabPageIndex;
if (idx > 0)
{
- Toast vm = new Toast(-1, "~宸插府浣犲垏鎹㈠埌銆愯壇鍝佹槑缁嗐��,璇烽噸鏂版搷浣渵");
+ Toast vm = new Toast(-1, "璇烽噸鏂版搷浣淍n宸插府浣犲垏鎹㈠埌銆愯壇鍝佹槑缁嗐��");
vm.Show();
tabMx.SelectedTabPageIndex = 0;
return;
@@ -180,7 +180,7 @@
}
if (_collectGuid.Length < 30)
{
- Toast vm = new Toast(-1, "~璇峰厛閫夋嫨杩芥函鐮亊");
+ Toast vm = new Toast(-1, "鎿嶄綔澶辫触@n璇峰厛閫夋嫨杩芥函鐮�");
vm.Show();
return;
}
@@ -218,7 +218,7 @@
string _txt = stringBuilder.ToString();
if (string.IsNullOrEmpty(_txt))
{
- Toast vm = new Toast(-1, "~褰撲负涓嶈壇鏃讹紝璇烽�夋嫨涓嶈壇椤圭洰~");
+ Toast vm = new Toast(-1, "鎿嶄綔澶辫触@n璇烽�夋嫨涓嶈壇椤圭洰");
vm.Show();
}
else
@@ -368,7 +368,7 @@
{
if (string.IsNullOrEmpty(_barCode))
{
- Toast vm = new Toast(-1, "~璇峰厛鎵拷婧爜~");
+ Toast vm = new Toast(-1, "鎿嶄綔澶辫触@n璇峰厛鎵弿杩芥函鐮�");
vm.Show();
this.ActiveControl = this.txt_barCode;
txt_barCode.Focus();
diff --git a/DevApp/Gs.DevApp/UserControl/Toast.Designer.cs b/DevApp/Gs.DevApp/UserControl/Toast.Designer.cs
index 9e11abf..3f471b3 100644
--- a/DevApp/Gs.DevApp/UserControl/Toast.Designer.cs
+++ b/DevApp/Gs.DevApp/UserControl/Toast.Designer.cs
@@ -28,77 +28,18 @@
/// </summary>
private void InitializeComponent()
{
- DevExpress.XtraLayout.ColumnDefinition columnDefinition1 = new DevExpress.XtraLayout.ColumnDefinition();
- DevExpress.XtraLayout.RowDefinition rowDefinition1 = new DevExpress.XtraLayout.RowDefinition();
- this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
- this.testo = new DevExpress.XtraEditors.LabelControl();
- this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
- this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
- this.layoutControl1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
+ this.lbMsg = new DevExpress.XtraEditors.LabelControl();
this.SuspendLayout();
//
- // layoutControl1
+ // lbMsg
//
- this.layoutControl1.Controls.Add(this.testo);
- this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.layoutControl1.Location = new System.Drawing.Point(0, 0);
- this.layoutControl1.Name = "layoutControl1";
- this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(815, 172, 812, 500);
- this.layoutControl1.Root = this.Root;
- this.layoutControl1.Size = new System.Drawing.Size(595, 261);
- this.layoutControl1.TabIndex = 9;
- this.layoutControl1.Text = "layoutControl1";
- //
- // testo
- //
- this.testo.Appearance.Options.UseBackColor = true;
- this.testo.Appearance.Options.UseFont = true;
- this.testo.Appearance.Options.UseForeColor = true;
- this.testo.Appearance.Options.UseTextOptions = true;
- this.testo.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
- this.testo.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
- this.testo.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
- this.testo.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.Vertical;
- this.testo.Location = new System.Drawing.Point(12, 121);
- this.testo.Name = "testo";
- this.testo.Size = new System.Drawing.Size(571, 18);
- this.testo.StyleController = this.layoutControl1;
- this.testo.TabIndex = 7;
- this.testo.Text = "labelControl1";
- //
- // Root
- //
- this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
- this.Root.GroupBordersVisible = false;
- this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
- this.layoutControlItem1});
- this.Root.LayoutMode = DevExpress.XtraLayout.Utils.LayoutMode.Table;
- this.Root.Name = "Root";
- columnDefinition1.SizeType = System.Windows.Forms.SizeType.Percent;
- columnDefinition1.Width = 100D;
- this.Root.OptionsTableLayoutGroup.ColumnDefinitions.AddRange(new DevExpress.XtraLayout.ColumnDefinition[] {
- columnDefinition1});
- rowDefinition1.Height = 100D;
- rowDefinition1.SizeType = System.Windows.Forms.SizeType.Percent;
- this.Root.OptionsTableLayoutGroup.RowDefinitions.AddRange(new DevExpress.XtraLayout.RowDefinition[] {
- rowDefinition1});
- this.Root.Size = new System.Drawing.Size(595, 261);
- this.Root.TextVisible = false;
- //
- // layoutControlItem1
- //
- this.layoutControlItem1.ContentHorzAlignment = DevExpress.Utils.HorzAlignment.Center;
- this.layoutControlItem1.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center;
- this.layoutControlItem1.Control = this.testo;
- this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
- this.layoutControlItem1.Name = "layoutControlItem1";
- this.layoutControlItem1.Size = new System.Drawing.Size(575, 241);
- this.layoutControlItem1.Text = "lbMsg";
- this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
- this.layoutControlItem1.TextVisible = false;
+ this.lbMsg.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lbMsg.Location = new System.Drawing.Point(0, 0);
+ this.lbMsg.Name = "lbMsg";
+ this.lbMsg.Padding = new System.Windows.Forms.Padding(2);
+ this.lbMsg.Size = new System.Drawing.Size(85, 22);
+ this.lbMsg.TabIndex = 0;
+ this.lbMsg.Text = "labelControl1";
//
// Toast
//
@@ -106,29 +47,22 @@
this.Appearance.Options.UseBackColor = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(595, 261);
+ this.ClientSize = new System.Drawing.Size(730, 172);
this.ControlBox = false;
- this.Controls.Add(this.layoutControl1);
+ this.Controls.Add(this.lbMsg);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Toast";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "VanishingMessage";
this.TopMost = true;
- this.TransparencyKey = System.Drawing.Color.White;
- ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
- this.layoutControl1.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
this.ResumeLayout(false);
+ this.PerformLayout();
}
#endregion
- private DevExpress.XtraLayout.LayoutControl layoutControl1;
- private DevExpress.XtraLayout.LayoutControlGroup Root;
- private DevExpress.XtraEditors.LabelControl testo;
- private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
+
+ private DevExpress.XtraEditors.LabelControl lbMsg;
}
}
\ No newline at end of file
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