72 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			72 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.ComponentModel;
 | |
| using System.Data;
 | |
| using System.Drawing;
 | |
| using System.Text;
 | |
| using System.Windows.Forms;
 | |
| 
 | |
| namespace PrintMSWord
 | |
| {
 | |
| 	public partial class frmInfo : Form
 | |
| 	{
 | |
| 		private StringBuilder _MyStringBuilder;
 | |
| 		public StringBuilder MyStringBuilder
 | |
| 		{
 | |
| 			get 
 | |
| 			{
 | |
| 				if (_MyStringBuilder == null)
 | |
| 					_MyStringBuilder = new StringBuilder();
 | |
| 				return _MyStringBuilder; 
 | |
| 			}
 | |
| 		}
 | |
| 		private Form _MyParent;
 | |
| 		public frmInfo(Form myParent)
 | |
| 		{
 | |
| 			_MyParent = myParent;
 | |
| 			InitializeComponent();
 | |
| 		}
 | |
| 		string _Sep = "";
 | |
| 		public string Sep
 | |
| 		{
 | |
| 			get { return _Sep; }
 | |
| 			set { _Sep = value; }
 | |
| 		}
 | |
| 		public void Clear()
 | |
| 		{
 | |
| 			_MyStringBuilder = null;
 | |
| 			tbInfo.Text = "";
 | |
| 			Sep = "";
 | |
| 			Hide();
 | |
| 		}
 | |
| 		public void AddInfo(string info)
 | |
| 		{
 | |
| 			tbInfo.Text += Sep + info;
 | |
| 			Sep = "\r\n";
 | |
| 			Show();
 | |
| 		}
 | |
| 		public void AddInfoPartial(string format, params object[] args)
 | |
| 		{
 | |
| 			MyStringBuilder.Append(Sep + string.Format(format,args));
 | |
| 			Sep = "\r\n";
 | |
| 			Application.DoEvents();
 | |
| 			if(!Visible)Show();
 | |
| 		}
 | |
| 		public string MyStatus
 | |
| 		{
 | |
| 			get { return tsslStatus.Text; }
 | |
| 			set { tsslStatus.Text = value; tbInfo.Text = MyStringBuilder.ToString(); Application.DoEvents(); }
 | |
| 		}
 | |
| 		public void CopyOutput()
 | |
| 		{
 | |
| 			Clipboard.Clear();
 | |
| 			Clipboard.SetText(tbInfo.Text);
 | |
| 		}
 | |
| 		private void frmInfo_Load(object sender, EventArgs e)
 | |
| 		{
 | |
| 			Rectangle rec = Screen.GetWorkingArea(this);
 | |
| 			Top = _MyParent.Top;
 | |
| 			Left = _MyParent.Right + Width > rec.Right ? rec.Right - Width : _MyParent.Right;
 | |
| 		}
 | |
| 	}
 | |
| } |