Example #1
0
        public void showAlert(string msg, int totalCount, enmType type)
        {
            this.Opacity       = 0.0;
            this.StartPosition = FormStartPosition.Manual;
            string fname;

            for (int i = 1; i < 10; i++)
            {
                fname = "alert" + i.ToString();
                Form_Alert frm = (Form_Alert)Application.OpenForms[fname];

                if (frm == null)
                {
                    this.Name     = fname;
                    this.x        = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15;
                    this.y        = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i;
                    this.Location = new Point(this.x, this.y);
                    break;
                }
            }
            switch (type)
            {
            case enmType.Success:
                this.pictureBox1.Image = Resources.success;
                break;

            case enmType.Warning:
                this.pictureBox1.Image = Resources.warning;
                break;
            }
            this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5;

            this.textBox1.Text = msg;
            this.label3.Text   = totalCount.ToString();

            this.Show();
            this.action = enumAction.start;
            this.timerAlert1.Interval = 1;
            this.timerAlert1.Start();
        }
Example #2
0
        public void Alert(string message, int totalCount, Form_Alert.enmType type)
        {
            Form_Alert alertForm = new Form_Alert();

            alertForm.showAlert(message, totalCount, type);
        }