Files
CheckDevice/Check.Main/UI/FrmLog.cs
17860779768 2e46747ba9 视觉修改
2025-08-25 16:33:58 +08:00

36 lines
845 B
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
namespace Check.Main.UI
{
public partial class FrmLog : DockContent
{
public FrmLog()
{
InitializeComponent();
}
public void AddLog(string message)
{
if (txtLog.InvokeRequired)
{
txtLog.BeginInvoke(new Action(() => AddLog(message)));
return;
}
if (txtLog.Lines.Length > 500)
{
txtLog.Clear();
}
txtLog.AppendText(message + Environment.NewLine);
txtLog.ScrollToCaret();
}
}
}