yhluo 4 сар өмнө
parent
commit
31bc3e5c3a

+ 1 - 0
UAS_MES_HGS/FunctionCode/Make/Make_ParseLog.Designer.cs

@@ -273,6 +273,7 @@
             this.lstFiles.Name = "lstFiles";
             this.lstFiles.Size = new System.Drawing.Size(978, 530);
             this.lstFiles.TabIndex = 0;
+            this.lstFiles.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.lstFiles_DrawItem_1);
             // 
             // panel3
             // 

+ 17 - 0
UAS_MES_HGS/FunctionCode/Make/Make_ParseLog.cs

@@ -449,6 +449,23 @@ namespace UAS_MES_NEW.Make
             }
             lstFiles.Items.Add($"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}] {message}");
             lstFiles.TopIndex = lstFiles.Items.Count - 1;
+            lstFiles.DrawMode = DrawMode.OwnerDrawFixed;
+        }
+
+        private void lstFiles_DrawItem_1(object sender, DrawItemEventArgs e)
+        {
+            e.DrawBackground();
+            Brush mybsh = Brushes.Black;
+            if (lstFiles.Items[e.Index].ToString().Contains("NG"))
+            {
+                mybsh = Brushes.Red;
+            }
+            else if (lstFiles.Items[e.Index].ToString().Contains("ERROR"))
+            {
+                mybsh = Brushes.Red;
+            }
+            e.DrawFocusRectangle();
+            e.Graphics.DrawString(lstFiles.Items[e.Index].ToString(), e.Font, mybsh, e.Bounds, StringFormat.GenericDefault);
         }
 
         public string CheckFileAccess(string filePath)