using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Microsoft.Win32; using System.IO; using System.Diagnostics; using System.Web; using System.Deployment.Application; using System.Threading; namespace BARCODELIBRARY { public partial class WaiteFrom : Form { private MainForm _MainForm; private Update _Update; private string _WaiteMessage = ""; private static WaiteFrom frmWaite = null; private WaiteFrom() { InitializeComponent(); } public static WaiteFrom GetInstance() { if (frmWaite == null || frmWaite.IsDisposed) { frmWaite = new WaiteFrom(); } return frmWaite; } private void SetWaiteMessage() { WaiteMessage.Text = this._WaiteMessage; WaiteMessage.Left = (this.Width - WaiteMessage.Width) / 2; WaiteMessage.Visible = true; this.BringToFront(); WaiteMessage.Refresh(); } public void ShowMessage(string Message) { _WaiteMessage = Message; SetWaiteMessage(); } private void WaiteFrom_Shown(object sender, EventArgs e) { //try //{ // _MainForm = this.Owner as MainForm; // _MainForm.Visible = false; //} //catch //{ // _Update = this.Owner as Update; // _Update.Visible = false; //} } private void WaiteFrom_FormClosed(object sender, FormClosedEventArgs e) { if (_MainForm != null) _MainForm.Visible = true; } } }