Exemplo n.º 1
0
        public void showAlert(string msg, enumType type)
        {
            this.Opacity       = 0.0f;
            this.StartPosition = FormStartPosition.Manual;
            string fname;

            for (int i = 0; i < 10; i++)
            {
                fname = "alert" + i.ToString();
                EventForm frm = (EventForm)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 + this.Height);
                    this.Location = new Point(this.x, this.y);
                    break;
                }
            }

            this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5;

            switch (type)
            {
            case enumType.Success:
                this.IconMessage.IconChar = FontAwesome.Sharp.IconChar.CheckCircle;
                this.BackColor            = Color.SeaGreen;
                break;

            case enumType.Error:
                this.IconMessage.IconChar = FontAwesome.Sharp.IconChar.Bomb;
                this.BackColor            = Color.DarkRed;
                break;

            case enumType.Info:
                this.IconMessage.IconChar = FontAwesome.Sharp.IconChar.InfoCircle;
                this.BackColor            = Color.RoyalBlue;
                break;

            case enumType.Warning:
                this.IconMessage.IconChar = FontAwesome.Sharp.IconChar.ExclamationCircle;
                this.BackColor            = Color.DarkOrange;
                break;
            }

            this.LabelMessageText.Text = msg;
            this.Show();
            this.action          = enumAction.start;
            this.timer1.Interval = 1;
            timer1.Start();
        }
Exemplo n.º 2
0
 private void Btn_Success_Click(object sender, EventArgs e)
 {
     eventForm = new EventForm("성공 했습니다.", EventForm.enumType.Success);
 }
Exemplo n.º 3
0
 private void Btn_Warning_Click(object sender, EventArgs e)
 {
     eventForm = new EventForm("실패 했습니다.", EventForm.enumType.Warning);
 }
Exemplo n.º 4
0
 private void Btn_Error_Click(object sender, EventArgs e)
 {
     eventForm = new EventForm("에러가 발생했습니다.", EventForm.enumType.Error);
 }
Exemplo n.º 5
0
 private void Btn_Info_Click(object sender, EventArgs e)
 {
     eventForm = new EventForm("정보가 출력됐습니다.", EventForm.enumType.Info);
 }