You are on page 1of 1

public partial class Form2 : Form

{
ListViewItem lista;
public Form2()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
string color = "";
if (checkBox1.Checked == true) color = color + " " + checkBox1.Text;
if (checkBox2.Checked == true) color = color + " " + checkBox2.Text;
if (checkBox3.Checked == true) color = color + " " + checkBox3.Text;

string sabor = "";


if (checkBox4.Checked == true) sabor = sabor + " " + checkBox4.Text;
if (checkBox5.Checked == true) sabor = sabor + " " + checkBox5.Text;
if (checkBox6.Checked == true) sabor = sabor + " " + checkBox6.Text;

string textura = "";


if (checkBox7.Checked == true) textura = textura + " " + checkBox7.Text;
if (checkBox8.Checked == true) textura = textura + " " + checkBox8.Text;
if (checkBox9.Checked == true) textura = textura + " " + checkBox9.Text;

lista = new ListViewItem(textBox1.Text);


listView1.Items.Add(lista);
lista.SubItems.Add(color);
lista.SubItems.Add(sabor);
lista.SubItems.Add(textura);
}
}
}

You might also like