private void btnPostpone_Click(object sender, EventArgs e) { timer1.Interval = 1; action = enmAction.close; // Send HTTP DATA }
public void showAlert(string msg, enmType type) { this.Opacity = 0.0; /*this.Location = new Point( * Screen.PrimaryScreen.Bounds.Width - 300, * Screen.PrimaryScreen.Bounds.Height * );*/ 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; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.Success: this.pictureBox1.Image = Resources.success; this.BackColor = Color.SeaGreen; break; case enmType.Error: this.pictureBox1.Image = Resources.error; this.BackColor = Color.DarkRed; break; case enmType.Info: this.pictureBox1.Image = Resources.info; this.BackColor = Color.RoyalBlue; break; case enmType.Warning: this.pictureBox1.Image = Resources.warning; this.BackColor = Color.DarkOrange; break; } this.lblMsg.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }
private void pictureBox2_Click(object sender, EventArgs e) { //timer1.Interval = 1; DialogResult dr = MessageBox.Show("Esta seguro de eliminar este comentario", "Confirmar?", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.Yes) { cComentarios.Eliminar(Comentario); } timer1.Interval = 1; action = enmAction.close; }
public void showAlert(string msg, 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; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.Success: this.iconPictureBox1.IconChar = FontAwesome.Sharp.IconChar.CheckCircle; this.BackColor = Color.SeaGreen; break; case enmType.Error: this.iconPictureBox1.IconChar = FontAwesome.Sharp.IconChar.Bug; this.BackColor = Color.DarkRed; break; case enmType.Info: this.iconPictureBox1.IconChar = FontAwesome.Sharp.IconChar.ExclamationCircle; this.BackColor = Color.RoyalBlue; break; case enmType.Warning: this.iconPictureBox1.IconChar = FontAwesome.Sharp.IconChar.ExclamationTriangle; this.BackColor = Color.DarkOrange; break; } this.lblMessage.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }
public void showAlert(string msg, 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; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { // See list of ui symbol at https://docs.microsoft.com/en-us/windows/uwp/design/style/segoe-ui-symbol-font case enmType.Success: labelIcon.Text = "\xEB68"; labelIcon.ForeColor = ColorTranslator.FromHtml("#3ddc84"); //this.BackColor = ColorTranslator.FromHtml("#3ddc84"); break; case enmType.Error: labelIcon.Text = "\xEB5E"; labelIcon.ForeColor = ColorTranslator.FromHtml("#f86734"); //this.BackColor = ColorTranslator.FromHtml("#f86734"); break; case enmType.Rung: labelIcon.Text = "\xEB8C"; labelIcon.ForeColor = ColorTranslator.FromHtml("#f1cc81"); SystemSounds.Beep.Play(); //this.BackColor = ColorTranslator.FromHtml("#f1cc81"); break; } this.alertMsg.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }
private void timer1_Tick(object sender, EventArgs e) { switch (this.action) { case enmAction.wait: timer1.Interval = 50000; action = enmAction.close; break; case Form_Alert.enmAction.start: this.timer1.Interval = 1; this.Opacity += 0.1; if (this.x < this.Location.X) { this.Left--; } else { if (this.Opacity == 1.0) { action = Form_Alert.enmAction.wait; } } break; case enmAction.close: timer1.Interval = 1; this.Opacity -= 0.1; this.Left -= 3; if (base.Opacity == 0.0) { base.Close(); } break; case enmAction.Frm: timer1.Interval = 1; New_Item Frm = new New_Item(); Frm.Show(); break; } }
private void timer1_Tick(object sender, EventArgs e) { switch (this.action) { case enmAction.wait: timer1.Interval = 5000; action = enmAction.close; break; case enmAction.start: timer1.Interval = 1; this.Opacity += 0.1; if (this.x < this.Location.X) { this.Top++; } else { if (this.Opacity == 1.0) { action = enmAction.wait; } } break; case enmAction.close: timer1.Interval = 1; this.Opacity -= 0.1; this.Top -= 5; if (base.Opacity == 0.0) { base.Close(); // home.home2.panel5.Visible = false; } break; } }
private void timer1_Tick(object sender, EventArgs e) { switch (this.action) { case enmAction.wait: timer1.Interval = 10000; action = enmAction.close; break; case enmAction.start: timer1.Interval = 1; this.Opacity += 0.1; if (this.x < this.Location.X) { this.Left--; } else { if (this.Opacity == 1.0) { action = enmAction.wait; } } break; case enmAction.close: timer1.Interval = 1; this.Opacity -= 0.1; this.Left -= 3; if (base.Opacity == 0.0) { base.Close(); } break; } }
private void pictureBox1_Click(object sender, EventArgs e) { //New_Item newItem = new New_Item(new Modelo.Requerimiento(), "A"); //newItem.FormBorderStyle = FormBorderStyle.None; //DialogResult dr = newItem.ShowDialog(); //if (dr == System.Windows.Forms.DialogResult.OK) // this.Close(); DialogResult dr = MessageBox.Show("¿Confirma el pedido de " + Comentario.Faltantes + " unidad del articulo" + Comentario.Articulo.Descripcion + "?", "Confirmar", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.Yes) { Modelo.Requerimiento Requerimiento = new Modelo.Requerimiento(); Requerimiento.Cantidad = Comentario.Faltantes; Requerimiento.Fecha = DateTime.Now; Requerimiento.Estado = false; Requerimiento.Articulo = Comentario.Articulo; Comentario.Estado = true; cComentarios.Modificar(Comentario); cReq.Agregar_Requerimiento(Requerimiento); } timer1.Interval = 1; action = enmAction.close; }
private void pictureBox2_Click(object sender, EventArgs e) { timer1.Interval = 1; action = enmAction.close; }
public void showAlert(string msg, enumType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 0; 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 - 20; //this.y = Screen.PrimaryScreen.Bounds.Height - this.Height * i -5 * i; //if (fname == "alert0") //{ this.y = Screen.PrimaryScreen.Bounds.Top - this.Top * i + 53 * i; //} this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enumType.Success: this.pictureBox1.Image = Resources.Success; this.BackColor = Color.SeaGreen; break; case enumType.Error: this.pictureBox1.Image = Resources.Error; this.BackColor = Color.DarkRed; break; case enumType.Info: this.pictureBox1.Image = Resources.Info; this.BackColor = Color.RoyalBlue; break; case enumType.Warning: this.pictureBox1.Image = Resources.Warning; this.BackColor = Color.DarkOrange; break; case enumType.Edit: this.pictureBox1.Image = Resources.Edit; this.BackColor = Color.Black; break; } this.lbl_Msg.Text = msg; // home.home2.addControlsTopanel2(this); // home.home2.panel5.Visible = true; // home.home2.Show(); this.Show(); //this.Focus(); this.action = enmAction.start; this.timer1.Interval = 1; timer1.Start(); }
private void button1_Click(object sender, EventArgs e) { timer1.Interval = 1; action = enmAction.close; }
private void button1_Click(object sender, EventArgs e) { timer1.Interval = 1; action = enmAction.close; //home.home2.panel5.Visible = false; }
public void showAlert(string title, string msg, 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; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; Color backgroundColor = Color.FromArgb(0, 88, 153); // Blue Color borderColor = Color.White; switch (type) { case enmType.Success: this.BackColor = backgroundColor; this.btnUpdate.BackColor = backgroundColor; this.btnUpdate.FlatAppearance.BorderColor = borderColor; this.btnUpdate.FlatAppearance.BorderSize = 2; this.btnPostpone.BackColor = backgroundColor; this.btnPostpone.FlatAppearance.BorderColor = borderColor; this.btnPostpone.FlatAppearance.BorderSize = 2; break; case enmType.Error: //this.pictureBox1.Image = Resources.error; this.BackColor = Color.DarkRed; break; case enmType.Info: //this.pictureBox1.Image = Resources.info; this.BackColor = Color.RoyalBlue; break; case enmType.Warning: //this.pictureBox1.Image = Resources.warning; this.BackColor = Color.DarkOrange; break; } this.lblTitle.Text = title; this.lblMsg.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }