Cada vez más cercas del final
This commit is contained in:
@@ -98,15 +98,32 @@ namespace compabetov2
|
||||
btnMenos.FlatStyle = FlatStyle.Flat;
|
||||
btnMenos.FlatAppearance.BorderSize = 0;
|
||||
btnMenos.BackColor = Color.FromArgb(33, 90, 255);
|
||||
|
||||
// Agregar esquinas redondeadas al botón
|
||||
System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
|
||||
gp.AddEllipse(0, 0, btnMenos.Width, btnMenos.Height);
|
||||
btnMenos.Region = new Region(gp);
|
||||
|
||||
btnMenos.Click += new EventHandler(delegate (object sender, EventArgs e)
|
||||
{
|
||||
int numeroContador = int.Parse(contador.Text.ToString());
|
||||
contador.Text = (numeroContador - 1).ToString();
|
||||
total -= producto.precion;
|
||||
|
||||
// Validar que el contador no sea 0 antes de restar
|
||||
if (numeroContador > 0)
|
||||
{
|
||||
contador.Text = (numeroContador - 1).ToString();
|
||||
total -= producto.precion;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Mostrar mensaje de advertencia
|
||||
MessageBox.Show("No puedes vender cosas negativas", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
Button btnMas = new Button();
|
||||
btnMas.Text = "+";
|
||||
btnMas.Width = 25;
|
||||
@@ -170,8 +187,13 @@ namespace compabetov2
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
MenuPrincipal menuPrincipal = new MenuPrincipal();
|
||||
menuPrincipal.Show();
|
||||
this.Dispose(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user