| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
-
- using System;
- using System.Windows.Forms;
- using PLC_S;
- namespace PLC_WF
- {
- public partial class F_Log : Form, IFormLogShow
- {
- public F_Log()
- {
- InitializeComponent();
- }
- public IShowFormLog ShowFormLog
- {
- get;
- set;
- }
- private void tsbWarp_Click(object sender, EventArgs e)
- {
- this.txtLog.WordWrap = !this.txtLog.WordWrap;
- if (this.txtLog.WordWrap)
- {
- this.tsbWarp.Text = "√折行";
- }
- else
- {
- this.tsbWarp.Text = " 折行";
- }
- }
- private void tsbClear_Click(object sender, EventArgs e)
- {
- this.txtLog.Text = null;
- }
- public void ShowLog(string log)
- {
- if (this.InvokeRequired)
- {
- this.BeginInvoke(new Action<string>(ShowLog), log);
- return;
- }
- this.txtLog.Text += log + System.Environment.NewLine;
- this.txtLog.SelectionStart = this.txtLog.Text.Length;
- this.txtLog.ScrollToCaret();
- }
- private void F_Log_FormClosed(object sender, FormClosedEventArgs e)
- {
- if (ShowFormLog != null)
- {
- ShowFormLog.FormLogShow = null;
- }
- }
- }
- }
|