You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.7 KiB
C#
72 lines
1.7 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing
|
|
{
|
|
public partial class Loading : Form
|
|
{
|
|
public Loading()
|
|
{
|
|
InitializeComponent();
|
|
this.ControlBox = true ;
|
|
this.MaximizeBox = false;
|
|
this.MinimizeBox = false;
|
|
}
|
|
|
|
private void loading_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
this.Opacity = 1;
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 关闭命令
|
|
/// </summary>
|
|
public void CloseOrder()
|
|
{
|
|
if (this.InvokeRequired)
|
|
{
|
|
//这里利用委托进行窗体的操作,避免跨线程调用时抛异常,后面给出具体定义
|
|
CONSTANTDEFINE.SetUISomeInfo UIinfo = new CONSTANTDEFINE.SetUISomeInfo(new System.Action(() =>
|
|
{
|
|
while (!this.IsHandleCreated)
|
|
{
|
|
;
|
|
}
|
|
|
|
if (!this.IsDisposed)
|
|
{
|
|
this.Dispose();
|
|
}
|
|
|
|
}));
|
|
this.Invoke(UIinfo);
|
|
}
|
|
else
|
|
{
|
|
if (this.IsDisposed)
|
|
return;
|
|
if (!this.IsDisposed)
|
|
{
|
|
this.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
private void loading_FormClosing(object sender, FormClosingEventArgs e)
|
|
{
|
|
if (!this.IsDisposed)
|
|
{
|
|
this.Dispose(true);
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
class CONSTANTDEFINE
|
|
{
|
|
public delegate void SetUISomeInfo();
|
|
}
|
|
}
|