From ab6b5aaa9c12693003410e1b836d466340793c21 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期六, 08 十一月 2025 15:06:53 +0800
Subject: [PATCH] 过站提示
---
DevApp/Gs.DevApp/XtraForm1.Designer.cs | 70 +++++++++++++++++++---
DevApp/Gs.DevApp/UserControl/Toast.Designer.cs | 2
DevApp/Gs.DevApp/App.config | 4
DevApp/Gs.DevApp/UserControl/Toast.cs | 18 +++++
DevApp/Gs.DevApp/XtraForm1.cs | 28 +++++++++
5 files changed, 106 insertions(+), 16 deletions(-)
diff --git a/DevApp/Gs.DevApp/App.config b/DevApp/Gs.DevApp/App.config
index 432ab84..8cf35bf 100644
--- a/DevApp/Gs.DevApp/App.config
+++ b/DevApp/Gs.DevApp/App.config
@@ -37,8 +37,8 @@
<appSettings>
<!--<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="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" />
<add key="PageSize" value="50" />
diff --git a/DevApp/Gs.DevApp/UserControl/Toast.Designer.cs b/DevApp/Gs.DevApp/UserControl/Toast.Designer.cs
index 3f471b3..7a51f2e 100644
--- a/DevApp/Gs.DevApp/UserControl/Toast.Designer.cs
+++ b/DevApp/Gs.DevApp/UserControl/Toast.Designer.cs
@@ -47,7 +47,7 @@
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(730, 172);
+ this.ClientSize = new System.Drawing.Size(298, 260);
this.ControlBox = false;
this.Controls.Add(this.lbMsg);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
diff --git a/DevApp/Gs.DevApp/UserControl/Toast.cs b/DevApp/Gs.DevApp/UserControl/Toast.cs
index 7513510..5cd8583 100644
--- a/DevApp/Gs.DevApp/UserControl/Toast.cs
+++ b/DevApp/Gs.DevApp/UserControl/Toast.cs
@@ -19,10 +19,24 @@
public Toast(int it, string messageText, int vanishingSeconds = 5)
{
InitializeComponent();
- messageText=messageText.Replace("@n", "\r\n");
+ this.StartPosition = FormStartPosition.CenterScreen; // 璁剧疆绐椾綋灞呬腑鏄剧ず
+ this.AutoScaleMode = AutoScaleMode.Font; // 鏍规嵁绯荤粺瀛椾綋澶у皬
+ int clientWidth=0;
+ int clientHeight = 0;
this.lbMsg.BackColor = System.Drawing.Color.Firebrick;
this.lbMsg.Font = new System.Drawing.Font("Tahoma", 38F);
this.lbMsg.ForeColor = System.Drawing.Color.White;
+ messageText = messageText.Replace("@n", "\r\n");
+ using (Graphics graphics = this.CreateGraphics())
+ {
+ Size textSize = TextRenderer.MeasureText(messageText, lbMsg.Font);
+ clientWidth = (int)textSize.Width;
+ clientHeight= (int)textSize.Height+10;
+ }
+ this.ClientSize = new System.Drawing.Size(clientWidth, clientHeight);
+ this.StartPosition = FormStartPosition.CenterScreen; // 璁剧疆绐椾綋灞呬腑鏄剧ず
+ this.AutoScaleMode = AutoScaleMode.Font; // 鏍规嵁绯荤粺瀛椾綋澶у皬
+ this.CenterToScreen();
try
{
string _vanishingSeconds = ConfigurationManager.AppSettings["ToastSeconds"];
@@ -70,6 +84,6 @@
tmr2.Interval = (int)TimeSpan.FromMilliseconds(50).TotalMilliseconds;
tmr2.Start();
}
-
+
}
}
\ No newline at end of file
diff --git a/DevApp/Gs.DevApp/XtraForm1.Designer.cs b/DevApp/Gs.DevApp/XtraForm1.Designer.cs
index baa9b9b..bbd3627 100644
--- a/DevApp/Gs.DevApp/XtraForm1.Designer.cs
+++ b/DevApp/Gs.DevApp/XtraForm1.Designer.cs
@@ -35,12 +35,16 @@
this.label1 = new System.Windows.Forms.Label();
this.txt_slaveAddress = new DevExpress.XtraEditors.ComboBoxEdit();
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
+ this.simpleButton3 = new DevExpress.XtraEditors.SimpleButton();
this.button1 = new System.Windows.Forms.Button();
this.btnEdit = new DevExpress.XtraEditors.ButtonEdit();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
this.txtGWM = new DevExpress.XtraEditors.TextEdit();
- this.simpleButton3 = new DevExpress.XtraEditors.SimpleButton();
+ this.simpleButton4 = new DevExpress.XtraEditors.SimpleButton();
+ this.simpleButton5 = new DevExpress.XtraEditors.SimpleButton();
+ this.simpleButton6 = new DevExpress.XtraEditors.SimpleButton();
+ this.simpleButton7 = new DevExpress.XtraEditors.SimpleButton();
((System.ComponentModel.ISupportInitialize)(this.txtGs.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.txt_slaveAddress.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit();
@@ -61,9 +65,9 @@
// richTextBox1
//
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.richTextBox1.Location = new System.Drawing.Point(0, 120);
+ this.richTextBox1.Location = new System.Drawing.Point(0, 365);
this.richTextBox1.Name = "richTextBox1";
- this.richTextBox1.Size = new System.Drawing.Size(887, 539);
+ this.richTextBox1.Size = new System.Drawing.Size(887, 294);
this.richTextBox1.TabIndex = 2;
this.richTextBox1.Text = "";
//
@@ -115,6 +119,10 @@
//
// panelControl1
//
+ this.panelControl1.Controls.Add(this.simpleButton7);
+ this.panelControl1.Controls.Add(this.simpleButton6);
+ this.panelControl1.Controls.Add(this.simpleButton5);
+ this.panelControl1.Controls.Add(this.simpleButton4);
this.panelControl1.Controls.Add(this.simpleButton3);
this.panelControl1.Controls.Add(this.button1);
this.panelControl1.Controls.Add(this.btnEdit);
@@ -129,8 +137,17 @@
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Top;
this.panelControl1.Location = new System.Drawing.Point(0, 0);
this.panelControl1.Name = "panelControl1";
- this.panelControl1.Size = new System.Drawing.Size(887, 120);
+ this.panelControl1.Size = new System.Drawing.Size(887, 365);
this.panelControl1.TabIndex = 7;
+ //
+ // simpleButton3
+ //
+ this.simpleButton3.Location = new System.Drawing.Point(475, 6);
+ this.simpleButton3.Name = "simpleButton3";
+ this.simpleButton3.Size = new System.Drawing.Size(94, 29);
+ this.simpleButton3.TabIndex = 12;
+ this.simpleButton3.Text = "simpleButton3";
+ this.simpleButton3.Click += new System.EventHandler(this.simpleButton3_Click);
//
// button1
//
@@ -176,14 +193,41 @@
this.txtGWM.Size = new System.Drawing.Size(183, 24);
this.txtGWM.TabIndex = 7;
//
- // simpleButton3
+ // simpleButton4
//
- this.simpleButton3.Location = new System.Drawing.Point(475, 6);
- this.simpleButton3.Name = "simpleButton3";
- this.simpleButton3.Size = new System.Drawing.Size(94, 29);
- this.simpleButton3.TabIndex = 12;
- this.simpleButton3.Text = "simpleButton3";
- this.simpleButton3.Click += new System.EventHandler(this.simpleButton3_Click);
+ this.simpleButton4.Location = new System.Drawing.Point(57, 179);
+ this.simpleButton4.Name = "simpleButton4";
+ this.simpleButton4.Size = new System.Drawing.Size(202, 29);
+ this.simpleButton4.TabIndex = 13;
+ this.simpleButton4.Text = "涓嶈壇鍘熷洜涓嶈兘涓虹┖锛�";
+ this.simpleButton4.Click += new System.EventHandler(this.simpleButton4_Click);
+ //
+ // simpleButton5
+ //
+ this.simpleButton5.Location = new System.Drawing.Point(57, 227);
+ this.simpleButton5.Name = "simpleButton5";
+ this.simpleButton5.Size = new System.Drawing.Size(202, 29);
+ this.simpleButton5.TabIndex = 14;
+ this.simpleButton5.Text = "鎿嶄綔澶辫触@n璇峰厛鎵弿宸ヤ綅鐮�";
+ this.simpleButton5.Click += new System.EventHandler(this.simpleButton5_Click);
+ //
+ // simpleButton6
+ //
+ this.simpleButton6.Location = new System.Drawing.Point(57, 283);
+ this.simpleButton6.Name = "simpleButton6";
+ this.simpleButton6.Size = new System.Drawing.Size(337, 29);
+ this.simpleButton6.TabIndex = 15;
+ this.simpleButton6.Text = "璇烽噸鏂版搷浣淍n宸插府浣犲垏鎹㈠埌銆愯壇鍝佹槑缁嗐��";
+ this.simpleButton6.Click += new System.EventHandler(this.simpleButton6_Click);
+ //
+ // simpleButton7
+ //
+ this.simpleButton7.Location = new System.Drawing.Point(57, 318);
+ this.simpleButton7.Name = "simpleButton7";
+ this.simpleButton7.Size = new System.Drawing.Size(337, 29);
+ this.simpleButton7.TabIndex = 16;
+ this.simpleButton7.Text = "鎿嶄綔澶辫触@n璇峰厛閫夋嫨杩芥函鐮�";
+ this.simpleButton7.Click += new System.EventHandler(this.simpleButton7_Click);
//
// XtraForm1
//
@@ -219,5 +263,9 @@
private DevExpress.XtraEditors.ButtonEdit btnEdit;
private System.Windows.Forms.Button button1;
private DevExpress.XtraEditors.SimpleButton simpleButton3;
+ private DevExpress.XtraEditors.SimpleButton simpleButton4;
+ private DevExpress.XtraEditors.SimpleButton simpleButton5;
+ private DevExpress.XtraEditors.SimpleButton simpleButton6;
+ private DevExpress.XtraEditors.SimpleButton simpleButton7;
}
}
\ No newline at end of file
diff --git a/DevApp/Gs.DevApp/XtraForm1.cs b/DevApp/Gs.DevApp/XtraForm1.cs
index 77292b8..0299600 100644
--- a/DevApp/Gs.DevApp/XtraForm1.cs
+++ b/DevApp/Gs.DevApp/XtraForm1.cs
@@ -355,5 +355,33 @@
throw new Exception(ziDuan + "涓嶆槸鍚堟硶鐨勬棩鏈熺被鍨嬶紒");
}
+ private void simpleButton4_Click(object sender, EventArgs e)
+ {
+
+ Toast vm = new Toast(0, simpleButton4.Text);
+ vm.Show();
+ return;
+ }
+
+ private void simpleButton5_Click(object sender, EventArgs e)
+ {
+ Toast vm = new Toast(0, simpleButton5.Text);
+ vm.Show();
+ return;
+ }
+
+ private void simpleButton6_Click(object sender, EventArgs e)
+ {
+ Toast vm = new Toast(0, simpleButton6.Text);
+ vm.Show();
+ return;
+ }
+
+ private void simpleButton7_Click(object sender, EventArgs e)
+ {
+ Toast vm = new Toast(0, simpleButton7.Text);
+ vm.Show();
+ return;
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3