Files
Groupware/Project/fLog.cs
2024-05-08 14:53:55 +09:00

49 lines
1.2 KiB
C#

using FCOMMON;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Project
{
public partial class fLog : fBase
{
public fLog()
{
InitializeComponent();
Pub.log.RaiseMsg += Log_RaiseMsg;
this.FormClosed += FLog_FormClosed;
this.KeyDown += (s1, e1) => {
if (e1.KeyCode == Keys.Escape) this.Close();
};
}
private void FLog_FormClosed(object sender, FormClosedEventArgs e)
{
Pub.log.RaiseMsg -= Log_RaiseMsg;
}
private void __Load(object sender, EventArgs e)
{
EnsureVisibleAndUsableSize();
}
private void Log_RaiseMsg(DateTime LogTime, string TypeStr, string Message)
{
this.logTextBox1.AddMsg(TypeStr, Message);
}
private void button1_Click(object sender, EventArgs e)
{
this.logTextBox1.LoadFile(Pub.log.FileName, RichTextBoxStreamType.PlainText);
this.logTextBox1.ForeColor = Color.White;
}
}
}