Bladeren bron

加正确提示音

shim 8 jaren geleden
bovenliggende
commit
2c586e2b18
2 gewijzigde bestanden met toevoegingen van 18 en 7 verwijderingen
  1. 18 7
      UAS-MES/CustomControl/RichText/RichTextAutoBottom.cs
  2. BIN
      UAS-MES/Resources/Sound/69978.wav

+ 18 - 7
UAS-MES/CustomControl/RichText/RichTextAutoBottom.cs

@@ -9,8 +9,7 @@ namespace UAS_MES.CustomControl.RichText
     public partial class RichTextAutoBottom : RichTextBox
     {
         Thread thread;
-        string FileName = Application.StartupPath + @"\Resources\Sound\5185.wav";
-
+        string FileName = "";
         public RichTextAutoBottom()
         {
             InitializeComponent();
@@ -36,9 +35,15 @@ namespace UAS_MES.CustomControl.RichText
             //如果颜色是红色则进行提示音
             if (color == Color.Red && Entity.SystemInf.CheckAudioEnable)
             {
-                thread.Start();
-                thread = new Thread(PlaySound);
+                FileName = Application.StartupPath + @"\Resources\Sound\5185.wav";
+            }
+            else
+            {
+                //颜色是绿色,进行正确提示音
+                FileName = Application.StartupPath + @"\Resources\Sound\69978.wav";
             }
+            thread.Start();
+            thread = new Thread(PlaySound);
         }
 
         /// <summary>
@@ -47,7 +52,7 @@ namespace UAS_MES.CustomControl.RichText
         /// <param name="str"></param>
         /// <param name="color"></param>
         /// <param name="ctl"></param>
-        public void AppendText(string str, Color color,Control ctl)
+        public void AppendText(string str, Color color, Control ctl)
         {
             SelectionColor = color;
             base.AppendText(str);
@@ -55,9 +60,15 @@ namespace UAS_MES.CustomControl.RichText
             //如果颜色是红色则进行提示音
             if (color == Color.Red && Entity.SystemInf.CheckAudioEnable)
             {
-                thread.Start();
-                thread = new Thread(PlaySound);
+                FileName = Application.StartupPath + @"\Resources\Sound\5185.wav";
             }
+            else
+            {
+                //颜色是绿色,进行正确提示音
+                FileName = Application.StartupPath + @"\Resources\Sound\69978.wav";
+            }
+            thread.Start();
+            thread = new Thread(PlaySound);
         }
 
         private void PlaySound()

BIN
UAS-MES/Resources/Sound/69978.wav