using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
// http://social.msdn.microsoft.com/Forums/es-ES/6b834135-b0d1-4ec8-aa50-ba3316bfd5b5/conseguir-unos-objetivos-que-no-me-salen-con-c-2013?forum=vcses
// http://foro.elhacker.net/net/no_me_salen_algunas_cosas_con_c-t420178.0.html
// http://www.forosdelweb.com/f29/no-salen-algunas-cosas-con-c-1107200/
namespace Picture_Colores
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
bool Color_5x7 = true;
bool Color_p1_5x7 = false;
bool Color_p2_5x7 = false;
bool Color_p3_5x7 = false;
bool Color_p4_5x7 = false;
private void checkBox_Color_5x7_CheckedChanged(object sender, EventArgs e)
{
if (Color_5x7 == false)
{
groupBox1.BackColor = Color.LawnGreen;
groupBox1.ForeColor = Color.Black;
if (Color_p1_5x7 == false)
{
pictureBox1.BackColor = Color.Lime;
}
else
{
pictureBox1.BackColor = Color.Black;
}
if (Color_p2_5x7 == false)
{
pictureBox2.BackColor = Color.Lime;
}
else
{
pictureBox2.BackColor = Color.Black;
}
if (Color_p3_5x7 == false)
{
pictureBox3.BackColor = Color.Lime;
}
else
{
pictureBox3.BackColor = Color.Black;
}
if (Color_p4_5x7 == false)
{
pictureBox4.BackColor = Color.Lime;
}
else
{
pictureBox4.BackColor = Color.Black;
}
Color_5x7 = true;
}
else
{
groupBox1.BackColor = Color.RoyalBlue;
groupBox1.ForeColor = Color.White;
if (Color_p1_5x7 == false)
{
pictureBox1.BackColor = Color.Blue;
}
else
{
pictureBox1.BackColor = Color.White;
}
if (Color_p2_5x7 == false)
{
pictureBox2.BackColor = Color.Blue;
}
else
{
pictureBox2.BackColor = Color.White;
}
if (Color_p3_5x7 == false)
{
pictureBox3.BackColor = Color.Blue;
}
else
{
pictureBox3.BackColor = Color.White;
}
if (Color_p4_5x7 == false)
{
pictureBox4.BackColor = Color.Blue;
}
else
{
pictureBox4.BackColor = Color.White;
}
Color_5x7 = false;
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
if (checkBox_Color_5x7
.Checked == false) {
if (Color_p1_5x7 == true)
{
pictureBox1.BackColor = Color.Lime;
Color_p1_5x7 = false;
}
else
{
pictureBox1.BackColor = Color.Black;
Color_p1_5x7 = true;
}
}
else
{
if (Color_p1_5x7 == true)
{
pictureBox1.BackColor = Color.Blue;
Color_p1_5x7 = false;
}
else
{
pictureBox1.BackColor = Color.White;
Color_p1_5x7 = true;
}
}
}
private void pictureBox2_Click(object sender, EventArgs e)
{
if (checkBox_Color_5x7
.Checked == false) {
if (Color_p2_5x7 == true)
{
pictureBox2.BackColor = Color.Lime;
Color_p2_5x7 = false;
}
else
{
pictureBox2.BackColor = Color.Black;
Color_p2_5x7 = true;
}
}
else
{
if (Color_p2_5x7 == true)
{
pictureBox2.BackColor = Color.Blue;
Color_p2_5x7 = false;
}
else
{
pictureBox2.BackColor = Color.White;
Color_p2_5x7 = true;
}
}
}
private void pictureBox3_Click(object sender, EventArgs e)
{
if (checkBox_Color_5x7
.Checked == false) {
if (Color_p3_5x7 == true)
{
pictureBox3.BackColor = Color.Lime;
Color_p3_5x7 = false;
}
else
{
pictureBox3.BackColor = Color.Black;
Color_p3_5x7 = true;
}
}
else
{
if (Color_p3_5x7 == true)
{
pictureBox3.BackColor = Color.Blue;
Color_p3_5x7 = false;
}
else
{
pictureBox3.BackColor = Color.White;
Color_p3_5x7 = true;
}
}
}
private void pictureBox4_Click(object sender, EventArgs e)
{
if (checkBox_Color_5x7
.Checked == false) {
if (Color_p4_5x7 == true)
{
pictureBox4.BackColor = Color.Lime;
Color_p4_5x7 = false;
}
else
{
pictureBox4.BackColor = Color.Black;
Color_p4_5x7 = true;
}
}
else
{
if (Color_p4_5x7 == true)
{
pictureBox4.BackColor = Color.Blue;
Color_p4_5x7 = false;
}
else
{
pictureBox4.BackColor = Color.White;
Color_p4_5x7 = true;
}
}
}
private void button_Invertir_Click(object sender, EventArgs e)
{
if (Color_5x7 == true)
{
if (Color_p1_5x7 == false)
{
Color_p1_5x7 = true;
pictureBox1.BackColor = Color.Black;
}
else
{
Color_p1_5x7 = false;
pictureBox1.BackColor = Color.Lime;
}
if (Color_p2_5x7 == false)
{
Color_p2_5x7 = true;
pictureBox2.BackColor = Color.Black;
}
else
{
Color_p2_5x7 = false;
pictureBox2.BackColor = Color.Lime;
}
if (Color_p3_5x7 == false)
{
Color_p3_5x7 = true;
pictureBox3.BackColor = Color.Black;
}
else
{
Color_p3_5x7 = false;
pictureBox3.BackColor = Color.Lime;
}
if (Color_p4_5x7 == false)
{
Color_p4_5x7 = true;
pictureBox4.BackColor = Color.Black;
}
else
{
Color_p4_5x7 = false;
pictureBox4.BackColor = Color.Lime;
}
}
else
{
if (Color_p1_5x7 == false)
{
Color_p1_5x7 = true;
pictureBox1.BackColor = Color.White;
}
else
{
Color_p1_5x7 = false;
pictureBox1.BackColor = Color.Blue;
}
if (Color_p2_5x7 == false)
{
Color_p2_5x7 = true;
pictureBox2.BackColor = Color.White;
}
else
{
Color_p2_5x7 = false;
pictureBox2.BackColor = Color.Blue;
}
if (Color_p3_5x7 == false)
{
Color_p3_5x7 = true;
pictureBox3.BackColor = Color.White;
}
else
{
Color_p3_5x7 = false;
pictureBox3.BackColor = Color.Blue;
}
if (Color_p4_5x7 == false)
{
Color_p4_5x7 = true;
pictureBox4.BackColor = Color.White;
}
else
{
Color_p4_5x7 = false;
pictureBox4.BackColor = Color.Blue;
}
}
}
}
}