123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace FPER
- {
- public partial class frmWaitingMsg : Form
- {
- public frmWaitingMsg()
- {
- InitializeComponent();
- }
- MDIParent parent;
- //화면이동을 위해---------------
- private Boolean WinMove = true;
- private Point mouseOffset;
- //--------------------------------------------------------
- public void Form_Init()
- {
- progressBar1.Value = 0;
- progressBar1.Maximum = 100;
- }
- private void frmWaittingMsg_Load(object sender, EventArgs e)
- {
- //dataGridView1.Rows.Clear();
- progressBar1.Maximum = 100;
- this.Show();
- }
- /********************************************************/
- /* 화면이동 */
- /********************************************************/
- private void frmWaittingMsg_MouseDown(object sender, MouseEventArgs e)
- {
- try
- {
- if (WinMove)
- {
- mouseOffset = new Point(-e.X, -e.Y);
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- private void frmWaittingMsg_MouseMove(object sender, MouseEventArgs e)
- {
- try
- {
- if (WinMove && (e.Button == MouseButtons.Left))
- {
- Point mousePos = Control.MousePosition;
- mousePos.Offset(mouseOffset.X, mouseOffset.Y);
- this.Location = mousePos;
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- /********************************************************/
- // cyim 2016.12.28 : 예외처리 추가 : 팝업창의 리소스가 수신반의 경우 중복으로 다량으로 발생할수가 있으므로 크로스 스레드 방지 코드가 필요하다
- delegate void WaitingMsg_Callback(string msg, int processValue);
- public void setMessage(string message, int processValue)
- {
- if (this.InvokeRequired)
- {
- WaitingMsg_Callback d = new WaitingMsg_Callback(setMessage);
- this.Invoke(d, new object[] { message, processValue });
- }
- else
- {
- lblMessageTitle.Text = message;
- progressBar1.Value = processValue;
- this.Refresh();
- }
- }
- public void setParent(MDIParent parent)
- {
- this.parent = parent;
- }
- private void frmWaittingMsg_FormClosed(object sender, FormClosedEventArgs e)
- {
- try
- {
- if (this.parent != null)
- {
- this.parent.CloseWaittingMsgForm();
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- }
- }
|