|
|
@@ -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()
|