Code
private void FrmMain_Load(object sender, EventArgs e)
{
private Thread sendPrintThread = new Thread(new ThreadStart(SendPrintControl))
sendPrintThread.Name = "SendPrint";
sendPrintThread.IsBackground = true;
sendPrintThread.Start();
}
private void SendPrintControl()
{
bool flag = true;
while (flag)
{
int count = this.GetFileCount();
if (count < 2)
{
flag = SendPrint();
RefreshPaperStatus();
}
}
if (sendPrintThread != null && sendPrintThread.ThreadState == ThreadState.Background)
{
sendPrintThread.Suspend();
}
if (toolStrip.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(SetText);
this.Invoke(d, new object[] { "打印开始" });
SetControlEnable EnableControl = new SetControlEnable(SetToolFunction);
this.Invoke(EnableControl, new object[] { false, true });
}
}